warscript 0.0.1-dev.fcc9d08 → 0.0.1-dev.fe0aeea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/types/effect.d.ts +1 -3
- package/core/types/effect.lua +26 -29
- package/core/types/sound.d.ts +17 -25
- package/core/types/sound.lua +86 -46
- package/core/util.lua +6 -1
- package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +3 -0
- package/engine/behaviour/ability/damage.lua +2 -2
- package/engine/behaviour/ability.d.ts +5 -1
- package/engine/behaviour/ability.lua +18 -4
- package/engine/behaviour/unit.d.ts +2 -0
- package/engine/buff.d.ts +13 -8
- package/engine/buff.lua +81 -50
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/unit.d.ts +6 -1
- package/engine/internal/unit.lua +8 -2
- package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/entry/ability-type/blank-configurable.lua +0 -9
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/curse.lua +2 -2
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type.d.ts +19 -17
- package/engine/object-data/entry/ability-type.lua +74 -21
- package/engine/object-data/entry/buff-type/applicable.lua +4 -4
- package/engine/object-data/entry/buff-type.d.ts +1 -1
- package/engine/object-data/entry/buff-type.lua +2 -2
- package/engine/object-data/entry/destructible-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.lua +4 -4
- package/engine/object-data/entry/lightning-type.d.ts +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +1 -1
- package/engine/object-data/entry/unit-type.lua +11 -11
- package/engine/object-data/entry/upgrade.d.ts +1 -1
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +16 -14
- package/engine/object-data/entry.lua +60 -32
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/objutil/unit.lua +2 -2
- package/package.json +2 -2
- package/utility/reflection.lua +11 -7
|
@@ -7,10 +7,11 @@ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
|
7
7
|
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
8
8
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
9
9
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
10
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
10
11
|
local __TS__StringSplit = ____lualib.__TS__StringSplit
|
|
11
12
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
12
13
|
local ____exports = {}
|
|
13
|
-
local booleanToData, dataToBoolean, numberToData, dataToNumber, stringToData, dataToString, objectDataEntryIdToData, dataToObjectDataEntryId, booleansToData, dataToBooleans, numbersToData, dataToNumbers, stringsToData, dataToStrings,
|
|
14
|
+
local booleanToData, dataToBoolean, numberToData, dataToNumber, stringToData, dataToString, objectDataEntryNumericIdToData, dataToObjectDataEntryNumericId, objectDataEntryIdToData, dataToObjectDataEntryId, booleansToData, dataToBooleans, numbersToData, dataToNumbers, stringsToData, dataToStrings, objectDataEntryNumericIdsToData, dataToObjectDataEntryNumericIds, isDataNotBlank
|
|
14
15
|
local ____attachment_2Dpreset = require("engine.object-data.auxiliary.attachment-preset")
|
|
15
16
|
local extractAttachmentPresetInputModelPath = ____attachment_2Dpreset.extractAttachmentPresetInputModelPath
|
|
16
17
|
local extractAttachmentPresetInputNodeFQN = ____attachment_2Dpreset.extractAttachmentPresetInputNodeFQN
|
|
@@ -124,7 +125,7 @@ function ObjectDataEntry.getAllByBaseIds(self, baseIds)
|
|
|
124
125
|
local constructor = self
|
|
125
126
|
for id, object in pairs(constructor:getObjectData(currentMap).all) do
|
|
126
127
|
if dataBaseIds[object.parentId or id] ~= nil then
|
|
127
|
-
local objectDataEntry = self:of(dataToObjectDataEntryId(id))
|
|
128
|
+
local objectDataEntry = self:of(dataToObjectDataEntryId(id, self.idType))
|
|
128
129
|
if objectDataEntry ~= nil and not objectDataEntry.isInternal then
|
|
129
130
|
result[#result + 1] = objectDataEntry
|
|
130
131
|
end
|
|
@@ -139,7 +140,7 @@ function ObjectDataEntry.getAll(self)
|
|
|
139
140
|
local constructor = self
|
|
140
141
|
local result = {}
|
|
141
142
|
for id in pairs(constructor:getObjectData(currentMap).all) do
|
|
142
|
-
local objectDataEntry = self:of(dataToObjectDataEntryId(id))
|
|
143
|
+
local objectDataEntry = self:of(dataToObjectDataEntryId(id, self.idType))
|
|
143
144
|
if objectDataEntry ~= nil and not objectDataEntry.isInternal then
|
|
144
145
|
result[#result + 1] = objectDataEntry
|
|
145
146
|
end
|
|
@@ -156,9 +157,9 @@ function ObjectDataEntry.of(self, id)
|
|
|
156
157
|
if object == nil then
|
|
157
158
|
return nil
|
|
158
159
|
end
|
|
159
|
-
local objectDataEntry = objectDataEntryByObjectDataEntryId[dataToObjectDataEntryId(object.id)]
|
|
160
|
+
local objectDataEntry = objectDataEntryByObjectDataEntryId[dataToObjectDataEntryId(object.id, self.idType)]
|
|
160
161
|
if objectDataEntry == nil then
|
|
161
|
-
if not constructor.IS_SYNTHETIC and (self.BASE_ID == 0 or dataToObjectDataEntryId(object.parentId) == self.BASE_ID) then
|
|
162
|
+
if not constructor.IS_SYNTHETIC and (self.BASE_ID == 0 or dataToObjectDataEntryId(object.parentId, self.idType) == self.BASE_ID) then
|
|
162
163
|
local AbstractObjectDataEntryView = __TS__Class()
|
|
163
164
|
AbstractObjectDataEntryView.name = "AbstractObjectDataEntryView"
|
|
164
165
|
__TS__ClassExtends(AbstractObjectDataEntryView, constructor)
|
|
@@ -231,13 +232,13 @@ function ObjectDataEntry.prototype.setStringField(self, field, value)
|
|
|
231
232
|
stringToData(value)
|
|
232
233
|
)
|
|
233
234
|
end
|
|
234
|
-
function ObjectDataEntry.prototype.
|
|
235
|
-
return
|
|
235
|
+
function ObjectDataEntry.prototype.getObjectDataEntryNumericIdField(self, field)
|
|
236
|
+
return dataToObjectDataEntryNumericId(self.object:getField(field))
|
|
236
237
|
end
|
|
237
|
-
function ObjectDataEntry.prototype.
|
|
238
|
+
function ObjectDataEntry.prototype.setObjectDataEntryNumericIdField(self, field, value)
|
|
238
239
|
self.object:setField(
|
|
239
240
|
field,
|
|
240
|
-
|
|
241
|
+
objectDataEntryNumericIdToData(value)
|
|
241
242
|
)
|
|
242
243
|
end
|
|
243
244
|
function ObjectDataEntry.prototype.getAttachmentPresetField(self, modelPathField, nodeFQNField)
|
|
@@ -285,13 +286,13 @@ function ObjectDataEntry.prototype.setStringsField(self, field, values)
|
|
|
285
286
|
stringsToData(values)
|
|
286
287
|
)
|
|
287
288
|
end
|
|
288
|
-
function ObjectDataEntry.prototype.
|
|
289
|
-
return
|
|
289
|
+
function ObjectDataEntry.prototype.getObjectDataEntryNumericIdsField(self, field)
|
|
290
|
+
return dataToObjectDataEntryNumericIds(self.object:getField(field))
|
|
290
291
|
end
|
|
291
|
-
function ObjectDataEntry.prototype.
|
|
292
|
+
function ObjectDataEntry.prototype.setObjectDataEntryNumericIdsField(self, field, values)
|
|
292
293
|
self.object:setField(
|
|
293
294
|
field,
|
|
294
|
-
|
|
295
|
+
objectDataEntryNumericIdsToData(values)
|
|
295
296
|
)
|
|
296
297
|
end
|
|
297
298
|
function ObjectDataEntry.prototype.getAttachmentPresetListField(self, modelPathListField, nodeFQNFields)
|
|
@@ -369,16 +370,16 @@ function ObjectDataEntry.prototype.setStringLevelField(self, field, values)
|
|
|
369
370
|
stringToData
|
|
370
371
|
)
|
|
371
372
|
end
|
|
372
|
-
function ObjectDataEntry.prototype.
|
|
373
|
-
return self:getLevelField(field,
|
|
373
|
+
function ObjectDataEntry.prototype.getObjectDataEntryNumericIdLevelField(self, field)
|
|
374
|
+
return self:getLevelField(field, dataToObjectDataEntryNumericId)
|
|
374
375
|
end
|
|
375
|
-
function ObjectDataEntry.prototype.
|
|
376
|
+
function ObjectDataEntry.prototype.setObjectDataEntryNumericIdLevelField(self, field, values)
|
|
376
377
|
self:setLevelField(
|
|
377
378
|
field,
|
|
378
379
|
values,
|
|
379
380
|
____exports.extractObjectDataEntryLevelFieldValue,
|
|
380
|
-
|
|
381
|
-
|
|
381
|
+
dataToObjectDataEntryNumericId,
|
|
382
|
+
objectDataEntryNumericIdToData
|
|
382
383
|
)
|
|
383
384
|
end
|
|
384
385
|
function ObjectDataEntry.prototype.getBooleansLevelField(self, field)
|
|
@@ -417,23 +418,26 @@ function ObjectDataEntry.prototype.setStringsLevelField(self, field, values)
|
|
|
417
418
|
stringsToData
|
|
418
419
|
)
|
|
419
420
|
end
|
|
420
|
-
function ObjectDataEntry.prototype.
|
|
421
|
-
return self:getLevelField(field,
|
|
421
|
+
function ObjectDataEntry.prototype.getObjectDataEntryNumericIdsLevelField(self, field)
|
|
422
|
+
return self:getLevelField(field, dataToObjectDataEntryNumericIds)
|
|
422
423
|
end
|
|
423
|
-
function ObjectDataEntry.prototype.
|
|
424
|
+
function ObjectDataEntry.prototype.setObjectDataEntryNumericIdsLevelField(self, field, values)
|
|
424
425
|
self:setLevelField(
|
|
425
426
|
field,
|
|
426
427
|
values,
|
|
427
428
|
____exports.extractObjectDataEntryLevelArrayFieldValue,
|
|
428
|
-
|
|
429
|
-
|
|
429
|
+
dataToObjectDataEntryNumericIds,
|
|
430
|
+
objectDataEntryNumericIdsToData
|
|
430
431
|
)
|
|
431
432
|
end
|
|
432
433
|
function ObjectDataEntry.prototype.getLevelField(self, field, dataToValue)
|
|
433
434
|
local values = {}
|
|
434
435
|
local object = self.object
|
|
435
436
|
for level = 1, tonumber(object:getField("levels")) or 1 do
|
|
436
|
-
values[level] = dataToValue(
|
|
437
|
+
values[level] = dataToValue(
|
|
438
|
+
object:getField((field .. "+") .. tostring(level)),
|
|
439
|
+
"number"
|
|
440
|
+
)
|
|
437
441
|
end
|
|
438
442
|
return values
|
|
439
443
|
end
|
|
@@ -473,6 +477,14 @@ function ObjectDataEntry.prototype.setLevelField(self, field, supplier, extracto
|
|
|
473
477
|
end
|
|
474
478
|
ObjectDataEntry.BASE_ID = 0
|
|
475
479
|
ObjectDataEntry.IS_SYNTHETIC = false
|
|
480
|
+
__TS__SetDescriptor(
|
|
481
|
+
ObjectDataEntry.prototype,
|
|
482
|
+
"type",
|
|
483
|
+
{get = function(self)
|
|
484
|
+
return self.constructor
|
|
485
|
+
end},
|
|
486
|
+
true
|
|
487
|
+
)
|
|
476
488
|
__TS__SetDescriptor(
|
|
477
489
|
ObjectDataEntry.prototype,
|
|
478
490
|
"isInternal",
|
|
@@ -491,11 +503,18 @@ __TS__SetDescriptor(
|
|
|
491
503
|
},
|
|
492
504
|
true
|
|
493
505
|
)
|
|
506
|
+
__TS__ObjectDefineProperty(
|
|
507
|
+
ObjectDataEntry,
|
|
508
|
+
"idType",
|
|
509
|
+
{get = function(self)
|
|
510
|
+
return type(self.BASE_ID) == "number" and "number" or "string"
|
|
511
|
+
end}
|
|
512
|
+
)
|
|
494
513
|
__TS__SetDescriptor(
|
|
495
514
|
ObjectDataEntry.prototype,
|
|
496
515
|
"id",
|
|
497
516
|
{get = function(self)
|
|
498
|
-
return dataToObjectDataEntryId(self.object.id)
|
|
517
|
+
return dataToObjectDataEntryId(self.object.id, self.type.idType)
|
|
499
518
|
end},
|
|
500
519
|
true
|
|
501
520
|
)
|
|
@@ -503,7 +522,7 @@ __TS__SetDescriptor(
|
|
|
503
522
|
ObjectDataEntry.prototype,
|
|
504
523
|
"baseId",
|
|
505
524
|
{get = function(self)
|
|
506
|
-
return dataToObjectDataEntryId(self.object.parentId or self.object.id)
|
|
525
|
+
return dataToObjectDataEntryId(self.object.parentId or self.object.id, self.type.idType)
|
|
507
526
|
end},
|
|
508
527
|
true
|
|
509
528
|
)
|
|
@@ -533,10 +552,10 @@ end
|
|
|
533
552
|
dataToString = function(data)
|
|
534
553
|
return tostring(data or "")
|
|
535
554
|
end
|
|
536
|
-
|
|
555
|
+
objectDataEntryNumericIdToData = function(value)
|
|
537
556
|
return value == 0 and "" or string.pack(">I4", value)
|
|
538
557
|
end
|
|
539
|
-
|
|
558
|
+
dataToObjectDataEntryNumericId = function(data)
|
|
540
559
|
local dataString = dataToString(data)
|
|
541
560
|
if isDataNotBlank(nil, dataString) then
|
|
542
561
|
return (string.unpack(">I4", dataString))
|
|
@@ -544,6 +563,15 @@ dataToObjectDataEntryId = function(data)
|
|
|
544
563
|
return 0
|
|
545
564
|
end
|
|
546
565
|
end
|
|
566
|
+
objectDataEntryIdToData = function(value)
|
|
567
|
+
return type(value) == "number" and objectDataEntryNumericIdToData(value) or value
|
|
568
|
+
end
|
|
569
|
+
dataToObjectDataEntryId = function(data, ____type)
|
|
570
|
+
if ____type == "number" then
|
|
571
|
+
return dataToObjectDataEntryNumericId(data)
|
|
572
|
+
end
|
|
573
|
+
return dataToString(data)
|
|
574
|
+
end
|
|
547
575
|
booleansToData = function(value)
|
|
548
576
|
return table.concat(
|
|
549
577
|
__TS__ArrayMap(
|
|
@@ -607,16 +635,16 @@ dataToStrings = function(data)
|
|
|
607
635
|
function(____, data) return dataToString(data) end
|
|
608
636
|
)
|
|
609
637
|
end
|
|
610
|
-
|
|
638
|
+
objectDataEntryNumericIdsToData = function(value)
|
|
611
639
|
return table.concat(
|
|
612
640
|
__TS__ArrayMap(
|
|
613
641
|
value,
|
|
614
|
-
function(____, objectDataEntryId) return
|
|
642
|
+
function(____, objectDataEntryId) return objectDataEntryNumericIdToData(objectDataEntryId) end
|
|
615
643
|
),
|
|
616
644
|
","
|
|
617
645
|
)
|
|
618
646
|
end
|
|
619
|
-
|
|
647
|
+
dataToObjectDataEntryNumericIds = function(data)
|
|
620
648
|
return __TS__ArrayMap(
|
|
621
649
|
__TS__ArrayFilter(
|
|
622
650
|
__TS__StringSplit(
|
|
@@ -625,7 +653,7 @@ dataToObjectDataEntryIds = function(data)
|
|
|
625
653
|
),
|
|
626
654
|
isDataNotBlank
|
|
627
655
|
),
|
|
628
|
-
function(____, data) return
|
|
656
|
+
function(____, data) return dataToObjectDataEntryNumericId(data) end
|
|
629
657
|
)
|
|
630
658
|
end
|
|
631
659
|
isDataNotBlank = function(self, data)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { StandardSoundPresetId } from "../../object-data/entry/sound-preset";
|
|
3
|
+
export declare const ABOMINATION_PISSED_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
4
|
+
export declare const ABOMINATION_READY_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
5
|
+
export declare const ABOMINATION_WAR_CRY_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
6
|
+
export declare const AXE_MEDIUM_CHOP_WOOD_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
7
|
+
export declare const IMPALE_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
8
|
+
export declare const IMPALE_HIT_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
9
|
+
export declare const IMPALE_LAND_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
10
|
+
export declare const IMPALE_CAST_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
____exports.ABOMINATION_PISSED_SOUND_PRESET_ID = "AbominationPissed"
|
|
3
|
+
____exports.ABOMINATION_READY_SOUND_PRESET_ID = "AbominationReady"
|
|
4
|
+
____exports.ABOMINATION_WAR_CRY_SOUND_PRESET_ID = "AbominationWarcry"
|
|
5
|
+
____exports.AXE_MEDIUM_CHOP_WOOD_SOUND_PRESET_ID = "AxeMediumChopWood"
|
|
6
|
+
____exports.IMPALE_SOUND_PRESET_ID = "Impale"
|
|
7
|
+
____exports.IMPALE_HIT_SOUND_PRESET_ID = "ImpaleHit"
|
|
8
|
+
____exports.IMPALE_LAND_SOUND_PRESET_ID = "ImpaleLand"
|
|
9
|
+
____exports.IMPALE_CAST_SOUND_PRESET_ID = "ImpaleCast"
|
|
10
|
+
return ____exports
|
package/objutil/unit.lua
CHANGED
|
@@ -596,7 +596,7 @@ __TS__SetDescriptor(
|
|
|
596
596
|
set = function(self, v)
|
|
597
597
|
self:setStringField("umdl", v)
|
|
598
598
|
if WarscriptConfig.AUTOMATICALLY_SET_UNIT_TYPE_PORTRAIT_MODEL_PATH then
|
|
599
|
-
self:setStringField("upor",
|
|
599
|
+
self:setStringField("upor", "")
|
|
600
600
|
end
|
|
601
601
|
end
|
|
602
602
|
},
|
|
@@ -612,7 +612,7 @@ __TS__SetDescriptor(
|
|
|
612
612
|
set = function(self, v)
|
|
613
613
|
self.object:setField("umdl:hd", v)
|
|
614
614
|
if WarscriptConfig.AUTOMATICALLY_SET_UNIT_TYPE_PORTRAIT_MODEL_PATH then
|
|
615
|
-
self.object:setField("upor:hd",
|
|
615
|
+
self.object:setField("upor:hd", "")
|
|
616
616
|
end
|
|
617
617
|
end
|
|
618
618
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "warscript",
|
|
4
|
-
"version": "0.0.1-dev.
|
|
4
|
+
"version": "0.0.1-dev.fe0aeea",
|
|
5
5
|
"description": "A typescript library for Warcraft III using Warpack.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"warcraft",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@warscript/language-extensions": "^0.0.1",
|
|
25
25
|
"@warscript/tstl-plugin": "^0.0.4",
|
|
26
26
|
"lua-types": "^2.13.1",
|
|
27
|
-
"warpack": "0.0.1-dev.
|
|
27
|
+
"warpack": "0.0.1-dev.9a8d1de"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
package/utility/reflection.lua
CHANGED
|
@@ -5,21 +5,25 @@ local checkNotNull = ____preconditions.checkNotNull
|
|
|
5
5
|
-- @internal For use by internal systems only.
|
|
6
6
|
____exports.implementReadonlyNumberIndexSupplier = function(clazz, supplier)
|
|
7
7
|
local metatable = checkNotNull(getmetatable(clazz))
|
|
8
|
-
local originalIndex = checkNotNull(metatable
|
|
8
|
+
local originalIndex = checkNotNull(rawget(metatable, "__index"))
|
|
9
9
|
local memoizedValueByKey = {}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
rawset(
|
|
11
|
+
metatable,
|
|
12
|
+
"__index",
|
|
13
|
+
function(self, key)
|
|
13
14
|
if type(key) == "number" then
|
|
14
|
-
local value =
|
|
15
|
-
|
|
15
|
+
local value = memoizedValueByKey[key]
|
|
16
|
+
if value == nil then
|
|
17
|
+
value = supplier(key)
|
|
18
|
+
memoizedValueByKey[key] = value
|
|
19
|
+
end
|
|
16
20
|
return value
|
|
17
21
|
end
|
|
18
22
|
if type(originalIndex) == "function" then
|
|
19
23
|
return originalIndex(self, key)
|
|
20
24
|
end
|
|
21
25
|
return originalIndex[key]
|
|
22
|
-
end
|
|
26
|
+
end
|
|
23
27
|
)
|
|
24
28
|
end
|
|
25
29
|
____exports.getClass = function(object)
|