| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
function old_createMetadataMethodsForProperty( |
| 27 |
metadataMap, |
| 28 |
kind, |
| 29 |
property, |
| 30 |
decoratorFinishedRef |
| 31 |
) { |
| 32 |
return { |
| 33 |
getMetadata: function (key) { |
| 34 |
old_assertNotFinished(decoratorFinishedRef, "getMetadata"); |
| 35 |
old_assertMetadataKey(key); |
| 36 |
|
| 37 |
var metadataForKey = metadataMap[key]; |
| 38 |
|
| 39 |
if (metadataForKey === void 0) return void 0; |
| 40 |
|
| 41 |
if (kind === 1 ) { |
| 42 |
var pub = metadataForKey.public; |
| 43 |
if (pub !== void 0) { |
| 44 |
return pub[property]; |
| 45 |
} |
| 46 |
} else if (kind === 2 ) { |
| 47 |
var priv = metadataForKey.private; |
| 48 |
if (priv !== void 0) { |
| 49 |
return priv.get(property); |
| 50 |
} |
| 51 |
} else if (Object.hasOwnProperty.call(metadataForKey, "constructor")) { |
| 52 |
return metadataForKey.constructor; |
| 53 |
} |
| 54 |
}, |
| 55 |
setMetadata: function (key, value) { |
| 56 |
old_assertNotFinished(decoratorFinishedRef, "setMetadata"); |
| 57 |
old_assertMetadataKey(key); |
| 58 |
|
| 59 |
var metadataForKey = metadataMap[key]; |
| 60 |
|
| 61 |
if (metadataForKey === void 0) { |
| 62 |
metadataForKey = metadataMap[key] = {}; |
| 63 |
} |
| 64 |
|
| 65 |
if (kind === 1 ) { |
| 66 |
var pub = metadataForKey.public; |
| 67 |
|
| 68 |
if (pub === void 0) { |
| 69 |
pub = metadataForKey.public = {}; |
| 70 |
} |
| 71 |
|
| 72 |
pub[property] = value; |
| 73 |
} else if (kind === 2 ) { |
| 74 |
var priv = metadataForKey.priv; |
| 75 |
|
| 76 |
if (priv === void 0) { |
| 77 |
priv = metadataForKey.private = new Map(); |
| 78 |
} |
| 79 |
|
| 80 |
priv.set(property, value); |
| 81 |
} else { |
| 82 |
metadataForKey.constructor = value; |
| 83 |
} |
| 84 |
}, |
| 85 |
}; |
| 86 |
} |
| 87 |
|
| 88 |
function old_convertMetadataMapToFinal(obj, metadataMap) { |
| 89 |
var parentMetadataMap = obj[Symbol.metadata || Symbol.for("Symbol.metadata")]; |
| 90 |
var metadataKeys = Object.getOwnPropertySymbols(metadataMap); |
| 91 |
|
| 92 |
if (metadataKeys.length === 0) return; |
| 93 |
|
| 94 |
for (var i = 0; i < metadataKeys.length; i++) { |
| 95 |
var key = metadataKeys[i]; |
| 96 |
var metaForKey = metadataMap[key]; |
| 97 |
var parentMetaForKey = parentMetadataMap ? parentMetadataMap[key] : null; |
| 98 |
|
| 99 |
var pub = metaForKey.public; |
| 100 |
var parentPub = parentMetaForKey ? parentMetaForKey.public : null; |
| 101 |
|
| 102 |
if (pub && parentPub) { |
| 103 |
Object.setPrototypeOf(pub, parentPub); |
| 104 |
} |
| 105 |
|
| 106 |
var priv = metaForKey.private; |
| 107 |
|
| 108 |
if (priv) { |
| 109 |
var privArr = Array.from(priv.values()); |
| 110 |
var parentPriv = parentMetaForKey ? parentMetaForKey.private : null; |
| 111 |
|
| 112 |
if (parentPriv) { |
| 113 |
privArr = privArr.concat(parentPriv); |
| 114 |
} |
| 115 |
|
| 116 |
metaForKey.private = privArr; |
| 117 |
} |
| 118 |
|
| 119 |
if (parentMetaForKey) { |
| 120 |
Object.setPrototypeOf(metaForKey, parentMetaForKey); |
| 121 |
} |
| 122 |
} |
| 123 |
|
| 124 |
if (parentMetadataMap) { |
| 125 |
Object.setPrototypeOf(metadataMap, parentMetadataMap); |
| 126 |
} |
| 127 |
|
| 128 |
obj[Symbol.metadata || Symbol.for("Symbol.metadata")] = metadataMap; |
| 129 |
} |
| 130 |
|
| 131 |
function old_createAddInitializerMethod(initializers, decoratorFinishedRef) { |
| 132 |
return function addInitializer(initializer) { |
| 133 |
old_assertNotFinished(decoratorFinishedRef, "addInitializer"); |
| 134 |
old_assertCallable(initializer, "An initializer"); |
| 135 |
initializers.push(initializer); |
| 136 |
}; |
| 137 |
} |
| 138 |
|
| 139 |
function old_memberDec( |
| 140 |
dec, |
| 141 |
name, |
| 142 |
desc, |
| 143 |
metadataMap, |
| 144 |
initializers, |
| 145 |
kind, |
| 146 |
isStatic, |
| 147 |
isPrivate, |
| 148 |
value |
| 149 |
) { |
| 150 |
var kindStr; |
| 151 |
|
| 152 |
switch (kind) { |
| 153 |
case 1 : |
| 154 |
kindStr = "accessor"; |
| 155 |
break; |
| 156 |
case 2 : |
| 157 |
kindStr = "method"; |
| 158 |
break; |
| 159 |
case 3 : |
| 160 |
kindStr = "getter"; |
| 161 |
break; |
| 162 |
case 4 : |
| 163 |
kindStr = "setter"; |
| 164 |
break; |
| 165 |
default: |
| 166 |
kindStr = "field"; |
| 167 |
} |
| 168 |
|
| 169 |
var ctx = { |
| 170 |
kind: kindStr, |
| 171 |
name: isPrivate ? "#" + name : name, |
| 172 |
isStatic: isStatic, |
| 173 |
isPrivate: isPrivate, |
| 174 |
}; |
| 175 |
|
| 176 |
var decoratorFinishedRef = { v: false }; |
| 177 |
|
| 178 |
if (kind !== 0 ) { |
| 179 |
ctx.addInitializer = old_createAddInitializerMethod( |
| 180 |
initializers, |
| 181 |
decoratorFinishedRef |
| 182 |
); |
| 183 |
} |
| 184 |
|
| 185 |
var metadataKind, metadataName; |
| 186 |
|
| 187 |
if (isPrivate) { |
| 188 |
metadataKind = 2 ; |
| 189 |
metadataName = Symbol(name); |
| 190 |
|
| 191 |
var access = {}; |
| 192 |
|
| 193 |
if (kind === 0 ) { |
| 194 |
access.get = desc.get; |
| 195 |
access.set = desc.set; |
| 196 |
} else if (kind === 2 ) { |
| 197 |
access.get = function () { |
| 198 |
return desc.value; |
| 199 |
}; |
| 200 |
} else { |
| 201 |
|
| 202 |
if (kind === 1 || kind === 3 ) { |
| 203 |
access.get = function () { |
| 204 |
return desc.get.call(this); |
| 205 |
}; |
| 206 |
} |
| 207 |
|
| 208 |
if (kind === 1 || kind === 4 ) { |
| 209 |
access.set = function (v) { |
| 210 |
desc.set.call(this, v); |
| 211 |
}; |
| 212 |
} |
| 213 |
} |
| 214 |
|
| 215 |
ctx.access = access; |
| 216 |
} else { |
| 217 |
metadataKind = 1 ; |
| 218 |
metadataName = name; |
| 219 |
} |
| 220 |
|
| 221 |
try { |
| 222 |
return dec( |
| 223 |
value, |
| 224 |
Object.assign( |
| 225 |
ctx, |
| 226 |
old_createMetadataMethodsForProperty( |
| 227 |
metadataMap, |
| 228 |
metadataKind, |
| 229 |
metadataName, |
| 230 |
decoratorFinishedRef |
| 231 |
) |
| 232 |
) |
| 233 |
); |
| 234 |
} finally { |
| 235 |
decoratorFinishedRef.v = true; |
| 236 |
} |
| 237 |
} |
| 238 |
|
| 239 |
function old_assertNotFinished(decoratorFinishedRef, fnName) { |
| 240 |
if (decoratorFinishedRef.v) { |
| 241 |
throw new Error( |
| 242 |
"attempted to call " + fnName + " after decoration was finished" |
| 243 |
); |
| 244 |
} |
| 245 |
} |
| 246 |
|
| 247 |
function old_assertMetadataKey(key) { |
| 248 |
if (typeof key !== "symbol") { |
| 249 |
throw new TypeError("Metadata keys must be symbols, received: " + key); |
| 250 |
} |
| 251 |
} |
| 252 |
|
| 253 |
function old_assertCallable(fn, hint) { |
| 254 |
if (typeof fn !== "function") { |
| 255 |
throw new TypeError(hint + " must be a function"); |
| 256 |
} |
| 257 |
} |
| 258 |
|
| 259 |
function old_assertValidReturnValue(kind, value) { |
| 260 |
var type = typeof value; |
| 261 |
|
| 262 |
if (kind === 1 ) { |
| 263 |
if (type !== "object" || value === null) { |
| 264 |
throw new TypeError( |
| 265 |
"accessor decorators must return an object with get, set, or init properties or void 0" |
| 266 |
); |
| 267 |
} |
| 268 |
if (value.get !== undefined) { |
| 269 |
old_assertCallable(value.get, "accessor.get"); |
| 270 |
} |
| 271 |
if (value.set !== undefined) { |
| 272 |
old_assertCallable(value.set, "accessor.set"); |
| 273 |
} |
| 274 |
if (value.init !== undefined) { |
| 275 |
old_assertCallable(value.init, "accessor.init"); |
| 276 |
} |
| 277 |
if (value.initializer !== undefined) { |
| 278 |
old_assertCallable(value.initializer, "accessor.initializer"); |
| 279 |
} |
| 280 |
} else if (type !== "function") { |
| 281 |
var hint; |
| 282 |
if (kind === 0 ) { |
| 283 |
hint = "field"; |
| 284 |
} else if (kind === 10 ) { |
| 285 |
hint = "class"; |
| 286 |
} else { |
| 287 |
hint = "method"; |
| 288 |
} |
| 289 |
throw new TypeError(hint + " decorators must return a function or void 0"); |
| 290 |
} |
| 291 |
} |
| 292 |
|
| 293 |
function old_getInit(desc) { |
| 294 |
var initializer; |
| 295 |
if ( |
| 296 |
(initializer = desc.init) == null && |
| 297 |
(initializer = desc.initializer) && |
| 298 |
typeof console !== "undefined" |
| 299 |
) { |
| 300 |
console.warn(".initializer has been renamed to .init as of March 2022"); |
| 301 |
} |
| 302 |
return initializer; |
| 303 |
} |
| 304 |
|
| 305 |
function old_applyMemberDec( |
| 306 |
ret, |
| 307 |
base, |
| 308 |
decInfo, |
| 309 |
name, |
| 310 |
kind, |
| 311 |
isStatic, |
| 312 |
isPrivate, |
| 313 |
metadataMap, |
| 314 |
initializers |
| 315 |
) { |
| 316 |
var decs = decInfo[0]; |
| 317 |
|
| 318 |
var desc, initializer, value; |
| 319 |
|
| 320 |
if (isPrivate) { |
| 321 |
if (kind === 0 || kind === 1 ) { |
| 322 |
desc = { |
| 323 |
get: decInfo[3], |
| 324 |
set: decInfo[4], |
| 325 |
}; |
| 326 |
} else if (kind === 3 ) { |
| 327 |
desc = { |
| 328 |
get: decInfo[3], |
| 329 |
}; |
| 330 |
} else if (kind === 4 ) { |
| 331 |
desc = { |
| 332 |
set: decInfo[3], |
| 333 |
}; |
| 334 |
} else { |
| 335 |
desc = { |
| 336 |
value: decInfo[3], |
| 337 |
}; |
| 338 |
} |
| 339 |
} else if (kind !== 0 ) { |
| 340 |
desc = Object.getOwnPropertyDescriptor(base, name); |
| 341 |
} |
| 342 |
|
| 343 |
if (kind === 1 ) { |
| 344 |
value = { |
| 345 |
get: desc.get, |
| 346 |
set: desc.set, |
| 347 |
}; |
| 348 |
} else if (kind === 2 ) { |
| 349 |
value = desc.value; |
| 350 |
} else if (kind === 3 ) { |
| 351 |
value = desc.get; |
| 352 |
} else if (kind === 4 ) { |
| 353 |
value = desc.set; |
| 354 |
} |
| 355 |
|
| 356 |
var newValue, get, set; |
| 357 |
|
| 358 |
if (typeof decs === "function") { |
| 359 |
newValue = old_memberDec( |
| 360 |
decs, |
| 361 |
name, |
| 362 |
desc, |
| 363 |
metadataMap, |
| 364 |
initializers, |
| 365 |
kind, |
| 366 |
isStatic, |
| 367 |
isPrivate, |
| 368 |
value |
| 369 |
); |
| 370 |
|
| 371 |
if (newValue !== void 0) { |
| 372 |
old_assertValidReturnValue(kind, newValue); |
| 373 |
|
| 374 |
if (kind === 0 ) { |
| 375 |
initializer = newValue; |
| 376 |
} else if (kind === 1 ) { |
| 377 |
initializer = old_getInit(newValue); |
| 378 |
get = newValue.get || value.get; |
| 379 |
set = newValue.set || value.set; |
| 380 |
|
| 381 |
value = { get: get, set: set }; |
| 382 |
} else { |
| 383 |
value = newValue; |
| 384 |
} |
| 385 |
} |
| 386 |
} else { |
| 387 |
for (var i = decs.length - 1; i >= 0; i--) { |
| 388 |
var dec = decs[i]; |
| 389 |
|
| 390 |
newValue = old_memberDec( |
| 391 |
dec, |
| 392 |
name, |
| 393 |
desc, |
| 394 |
metadataMap, |
| 395 |
initializers, |
| 396 |
kind, |
| 397 |
isStatic, |
| 398 |
isPrivate, |
| 399 |
value |
| 400 |
); |
| 401 |
|
| 402 |
if (newValue !== void 0) { |
| 403 |
old_assertValidReturnValue(kind, newValue); |
| 404 |
var newInit; |
| 405 |
|
| 406 |
if (kind === 0 ) { |
| 407 |
newInit = newValue; |
| 408 |
} else if (kind === 1 ) { |
| 409 |
newInit = old_getInit(newValue); |
| 410 |
get = newValue.get || value.get; |
| 411 |
set = newValue.set || value.set; |
| 412 |
|
| 413 |
value = { get: get, set: set }; |
| 414 |
} else { |
| 415 |
value = newValue; |
| 416 |
} |
| 417 |
|
| 418 |
if (newInit !== void 0) { |
| 419 |
if (initializer === void 0) { |
| 420 |
initializer = newInit; |
| 421 |
} else if (typeof initializer === "function") { |
| 422 |
initializer = [initializer, newInit]; |
| 423 |
} else { |
| 424 |
initializer.push(newInit); |
| 425 |
} |
| 426 |
} |
| 427 |
} |
| 428 |
} |
| 429 |
} |
| 430 |
|
| 431 |
if (kind === 0 || kind === 1 ) { |
| 432 |
if (initializer === void 0) { |
| 433 |
|
| 434 |
initializer = function (instance, init) { |
| 435 |
return init; |
| 436 |
}; |
| 437 |
} else if (typeof initializer !== "function") { |
| 438 |
var ownInitializers = initializer; |
| 439 |
|
| 440 |
initializer = function (instance, init) { |
| 441 |
var value = init; |
| 442 |
|
| 443 |
for (var i = 0; i < ownInitializers.length; i++) { |
| 444 |
value = ownInitializers[i].call(instance, value); |
| 445 |
} |
| 446 |
|
| 447 |
return value; |
| 448 |
}; |
| 449 |
} else { |
| 450 |
var originalInitializer = initializer; |
| 451 |
|
| 452 |
initializer = function (instance, init) { |
| 453 |
return originalInitializer.call(instance, init); |
| 454 |
}; |
| 455 |
} |
| 456 |
|
| 457 |
ret.push(initializer); |
| 458 |
} |
| 459 |
|
| 460 |
if (kind !== 0 ) { |
| 461 |
if (kind === 1 ) { |
| 462 |
desc.get = value.get; |
| 463 |
desc.set = value.set; |
| 464 |
} else if (kind === 2 ) { |
| 465 |
desc.value = value; |
| 466 |
} else if (kind === 3 ) { |
| 467 |
desc.get = value; |
| 468 |
} else if (kind === 4 ) { |
| 469 |
desc.set = value; |
| 470 |
} |
| 471 |
|
| 472 |
if (isPrivate) { |
| 473 |
if (kind === 1 ) { |
| 474 |
ret.push(function (instance, args) { |
| 475 |
return value.get.call(instance, args); |
| 476 |
}); |
| 477 |
ret.push(function (instance, args) { |
| 478 |
return value.set.call(instance, args); |
| 479 |
}); |
| 480 |
} else if (kind === 2 ) { |
| 481 |
ret.push(value); |
| 482 |
} else { |
| 483 |
ret.push(function (instance, args) { |
| 484 |
return value.call(instance, args); |
| 485 |
}); |
| 486 |
} |
| 487 |
} else { |
| 488 |
Object.defineProperty(base, name, desc); |
| 489 |
} |
| 490 |
} |
| 491 |
} |
| 492 |
|
| 493 |
function old_applyMemberDecs( |
| 494 |
ret, |
| 495 |
Class, |
| 496 |
protoMetadataMap, |
| 497 |
staticMetadataMap, |
| 498 |
decInfos |
| 499 |
) { |
| 500 |
var protoInitializers; |
| 501 |
var staticInitializers; |
| 502 |
|
| 503 |
var existingProtoNonFields = new Map(); |
| 504 |
var existingStaticNonFields = new Map(); |
| 505 |
|
| 506 |
for (var i = 0; i < decInfos.length; i++) { |
| 507 |
var decInfo = decInfos[i]; |
| 508 |
|
| 509 |
|
| 510 |
if (!Array.isArray(decInfo)) continue; |
| 511 |
|
| 512 |
var kind = decInfo[1]; |
| 513 |
var name = decInfo[2]; |
| 514 |
var isPrivate = decInfo.length > 3; |
| 515 |
|
| 516 |
var isStatic = kind >= 5; |
| 517 |
var base; |
| 518 |
var metadataMap; |
| 519 |
var initializers; |
| 520 |
|
| 521 |
if (isStatic) { |
| 522 |
base = Class; |
| 523 |
metadataMap = staticMetadataMap; |
| 524 |
kind = kind - 5 ; |
| 525 |
|
| 526 |
if (kind !== 0 ) { |
| 527 |
staticInitializers = staticInitializers || []; |
| 528 |
initializers = staticInitializers; |
| 529 |
} |
| 530 |
} else { |
| 531 |
base = Class.prototype; |
| 532 |
metadataMap = protoMetadataMap; |
| 533 |
|
| 534 |
if (kind !== 0 ) { |
| 535 |
protoInitializers = protoInitializers || []; |
| 536 |
initializers = protoInitializers; |
| 537 |
} |
| 538 |
} |
| 539 |
|
| 540 |
if (kind !== 0 && !isPrivate) { |
| 541 |
var existingNonFields = isStatic |
| 542 |
? existingStaticNonFields |
| 543 |
: existingProtoNonFields; |
| 544 |
|
| 545 |
var existingKind = existingNonFields.get(name) || 0; |
| 546 |
|
| 547 |
if ( |
| 548 |
existingKind === true || |
| 549 |
(existingKind === 3 && kind !== 4) || |
| 550 |
(existingKind === 4 && kind !== 3) |
| 551 |
) { |
| 552 |
throw new Error( |
| 553 |
"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + |
| 554 |
name |
| 555 |
); |
| 556 |
} else if (!existingKind && kind > 2 ) { |
| 557 |
existingNonFields.set(name, kind); |
| 558 |
} else { |
| 559 |
existingNonFields.set(name, true); |
| 560 |
} |
| 561 |
} |
| 562 |
|
| 563 |
old_applyMemberDec( |
| 564 |
ret, |
| 565 |
base, |
| 566 |
decInfo, |
| 567 |
name, |
| 568 |
kind, |
| 569 |
isStatic, |
| 570 |
isPrivate, |
| 571 |
metadataMap, |
| 572 |
initializers |
| 573 |
); |
| 574 |
} |
| 575 |
|
| 576 |
old_pushInitializers(ret, protoInitializers); |
| 577 |
old_pushInitializers(ret, staticInitializers); |
| 578 |
} |
| 579 |
|
| 580 |
function old_pushInitializers(ret, initializers) { |
| 581 |
if (initializers) { |
| 582 |
ret.push(function (instance) { |
| 583 |
for (var i = 0; i < initializers.length; i++) { |
| 584 |
initializers[i].call(instance); |
| 585 |
} |
| 586 |
return instance; |
| 587 |
}); |
| 588 |
} |
| 589 |
} |
| 590 |
|
| 591 |
function old_applyClassDecs(ret, targetClass, metadataMap, classDecs) { |
| 592 |
if (classDecs.length > 0) { |
| 593 |
var initializers = []; |
| 594 |
var newClass = targetClass; |
| 595 |
var name = targetClass.name; |
| 596 |
|
| 597 |
for (var i = classDecs.length - 1; i >= 0; i--) { |
| 598 |
var decoratorFinishedRef = { v: false }; |
| 599 |
|
| 600 |
try { |
| 601 |
var ctx = Object.assign( |
| 602 |
{ |
| 603 |
kind: "class", |
| 604 |
name: name, |
| 605 |
addInitializer: old_createAddInitializerMethod( |
| 606 |
initializers, |
| 607 |
decoratorFinishedRef |
| 608 |
), |
| 609 |
}, |
| 610 |
old_createMetadataMethodsForProperty( |
| 611 |
metadataMap, |
| 612 |
0 , |
| 613 |
name, |
| 614 |
decoratorFinishedRef |
| 615 |
) |
| 616 |
); |
| 617 |
var nextNewClass = classDecs[i](newClass, ctx); |
| 618 |
} finally { |
| 619 |
decoratorFinishedRef.v = true; |
| 620 |
} |
| 621 |
|
| 622 |
if (nextNewClass !== undefined) { |
| 623 |
old_assertValidReturnValue(10 , nextNewClass); |
| 624 |
newClass = nextNewClass; |
| 625 |
} |
| 626 |
} |
| 627 |
|
| 628 |
ret.push(newClass, function () { |
| 629 |
for (var i = 0; i < initializers.length; i++) { |
| 630 |
initializers[i].call(newClass); |
| 631 |
} |
| 632 |
}); |
| 633 |
} |
| 634 |
} |
| 635 |
|
| 636 |
|
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
|
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
|
| 648 |
|
| 649 |
|
| 650 |
|
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
|
| 655 |
|
| 656 |
|
| 657 |
|
| 658 |
|
| 659 |
|
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
|
| 676 |
|
| 677 |
|
| 678 |
|
| 679 |
|
| 680 |
|
| 681 |
|
| 682 |
|
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
|
| 695 |
|
| 696 |
|
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
|
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 |
|
| 707 |
|
| 708 |
|
| 709 |
|
| 710 |
|
| 711 |
|
| 712 |
|
| 713 |
|
| 714 |
|
| 715 |
|
| 716 |
|
| 717 |
|
| 718 |
|
| 719 |
|
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
|
| 725 |
|
| 726 |
|
| 727 |
|
| 728 |
|
| 729 |
|
| 730 |
|
| 731 |
|
| 732 |
|
| 733 |
|
| 734 |
|
| 735 |
|
| 736 |
|
| 737 |
|
| 738 |
|
| 739 |
|
| 740 |
|
| 741 |
|
| 742 |
|
| 743 |
|
| 744 |
|
| 745 |
|
| 746 |
|
| 747 |
|
| 748 |
|
| 749 |
|
| 750 |
|
| 751 |
|
| 752 |
|
| 753 |
|
| 754 |
|
| 755 |
|
| 756 |
|
| 757 |
|
| 758 |
|
| 759 |
|
| 760 |
|
| 761 |
|
| 762 |
|
| 763 |
|
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
|
| 768 |
|
| 769 |
|
| 770 |
|
| 771 |
|
| 772 |
|
| 773 |
|
| 774 |
|
| 775 |
|
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
|
| 781 |
export default function applyDecs(targetClass, memberDecs, classDecs) { |
| 782 |
var ret = []; |
| 783 |
var staticMetadataMap = {}; |
| 784 |
|
| 785 |
var protoMetadataMap = {}; |
| 786 |
|
| 787 |
old_applyMemberDecs( |
| 788 |
ret, |
| 789 |
targetClass, |
| 790 |
protoMetadataMap, |
| 791 |
staticMetadataMap, |
| 792 |
memberDecs |
| 793 |
); |
| 794 |
|
| 795 |
old_convertMetadataMapToFinal(targetClass.prototype, protoMetadataMap); |
| 796 |
|
| 797 |
old_applyClassDecs(ret, targetClass, staticMetadataMap, classDecs); |
| 798 |
|
| 799 |
old_convertMetadataMapToFinal(targetClass, staticMetadataMap); |
| 800 |
|
| 801 |
return ret; |
| 802 |
} |