-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlapys.js
More file actions
2447 lines (1977 loc) · 111 KB
/
lapys.js
File metadata and controls
2447 lines (1977 loc) · 111 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
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
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Global > Lapys
--- NOTE ---
#Lapys:
• Code standard built for all JavaScript versions
• Native features are validated (or internally shimmed otherwise)
• Unique character generated for validation tests: `ඞ` (or `\u0D9E`)
• Unique token generated for throwing `ReferenceError`s: `ㅤ` (or `\u3164`)
--- RULES ---
#Lapys:
• Enforce maximum of 255 arguments per function
• Minimize code indirection (due to prototype-chain lookup)
• Prefer declared function arguments over the exotic `arguments` object
--- TODO ---
#Lapys:
Validate `Function.prototype.toString()` against this ES6+ spoof:
Function.prototype.toString = ((native, invoke) => {
let subnative = new Proxy(native, {apply: (target, that, arguments) => invoke(native, [subnative === that ? native : that, arguments])});
return subnative
})(Function.prototype.toString, Function.prototype.apply.bind(Function.prototype.apply));
--- WARN ---
#Lapys:
Must be evaluated in "Sloppy Mode"
Negligibly ignored errors:
• Out-of-Memory errors raised by a `RecursionOverflowError` instance
Notably ignored legacy features:
• Array.observe(…)
• Array.unobserve(…)
• Object.getNotifier(…)
• Object.observe(…)
• Object.prototype.__count__
• Object.prototype.__iterator__
• Object.prototype.__noSuchMethod__
• Object.prototype.toSource(…)
• Object.prototype.unwatch(…)
• Object.prototype.watch(…)
• Object.unobserve(…)
• Proxy::hasOwn(…)
Possibly modified enumerables:
• Function.prototype.toString(…)
• Object.prototype.toString(…)
Possibly modified values:
• Error.prototype.name
• InternalError.prototype.name
• Object.prototype.name
• RangeError.prototype.name
• TypeError.prototype.name
*/
var Lapys = (function() {
var description = "General-purpose standard library for JavaScript";
var version = "0.0.1";
// ...
return new function(prototype) {
function Lapys() {}
Lapys.prototype = prototype;
Lapys = new Lapys;
Lapys.__proto__ = null;
delete prototype["constructor"];
delete prototype["__proto__"];
return Lapys
}({
"__proto__": null,
toString : function toString() { /* [private code] */ return "Lapys v" + version + "]: " + description }
})
})();
/* Namespace > ... */
var Console = {
print: null
};
var DOM = {
createElement : null,
getElementByClassName : null,
getElementsByClassName: null,
getElementById : null,
getElementsById : null,
getElementBySelector : null,
getElementsBySelector : null,
getElementByTagName : null,
getElementsByTagName : null
};
var Event = {
addListener : null,
removeListener: null
};
/* ... */
void function() {
/* Constant > ... */
var COMPLETED = false;
var ERROR = new PseudoError; // WARN (Lapys) -> Subject to modification when exception raised
var GLOBAL = "undefined" !== typeof this ? this : "undefined" !== typeof globalThis ? globalThis : "undefined" !== typeof frames ? frames : "undefined" !== typeof self ? self : "undefined" !== typeof window ? window : "undefined" !== typeof global ? global : (function() { return this })();
var VOID = /void/; // NOTE (Lapys) -> Invalidity or nullity
var RECURSION_OVERFLOW_ERROR = VOID;
var REFERENCE_ERROR = VOID;
var TYPE_ERROR = VOID;
/* Class */
/* Static Array ->> Array alternative before validating `Array.prototype.push(…)` */
function StaticArray(elements) {
this.length = arguments.length;
while (arguments.length--) // ->> Assumed `arguments.length < 256`
this[arguments.length] = arguments[arguments.length]
}
StaticArray.prototype = {
0: null, 1: null, 2: null, 3: null, 4: null, 5: null, 6: null, 7: null, 8: null, 9: null, 10: null, 11: null, 12: null, 13: null, 14: null, 15: null, 16: null, 17: null, 18: null, 19: null, 20: null, 21: null, 22: null, 23: null, 24: null, 25: null, 26: null, 27: null, 28: null, 29: null, 30: null, 31: null, 32: null, 33: null, 34: null, 35: null, 36: null, 37: null, 38: null, 39: null, 40: null, 41: null, 42: null, 43: null, 44: null, 45: null, 46: null, 47: null, 48: null, 49: null, 50: null, 51: null, 52: null, 53: null, 54: null, 55: null, 56: null, 57: null, 58: null, 59: null, 60: null, 61: null, 62: null, 63: null, 64: null, 65: null, 66: null, 67: null, 68: null, 69: null, 70: null, 71: null, 72: null, 73: null, 74: null, 75: null, 76: null, 77: null, 78: null, 79: null, 80: null, 81: null, 82: null, 83: null, 84: null, 85: null, 86: null, 87: null, 88: null, 89: null, 90: null, 91: null, 92: null, 93: null, 94: null, 95: null, 96: null, 97: null, 98: null, 99: null, 100: null, 101: null, 102: null, 103: null, 104: null, 105: null, 106: null, 107: null, 108: null, 109: null, 110: null, 111: null, 112: null, 113: null, 114: null, 115: null, 116: null, 117: null, 118: null, 119: null, 120: null, 121: null, 122: null, 123: null, 124: null, 125: null, 126: null, 127: null, 128: null, 129: null, 130: null, 131: null, 132: null, 133: null, 134: null, 135: null, 136: null, 137: null, 138: null, 139: null, 140: null, 141: null, 142: null, 143: null, 144: null, 145: null, 146: null, 147: null, 148: null, 149: null, 150: null, 151: null, 152: null, 153: null, 154: null, 155: null, 156: null, 157: null, 158: null, 159: null, 160: null, 161: null, 162: null, 163: null, 164: null, 165: null, 166: null, 167: null, 168: null, 169: null, 170: null, 171: null, 172: null, 173: null, 174: null, 175: null, 176: null, 177: null, 178: null, 179: null, 180: null, 181: null, 182: null, 183: null, 184: null, 185: null, 186: null, 187: null, 188: null, 189: null, 190: null, 191: null, 192: null, 193: null, 194: null, 195: null, 196: null, 197: null, 198: null, 199: null, 200: null, 201: null, 202: null, 203: null, 204: null, 205: null, 206: null, 207: null, 208: null, 209: null, 210: null, 211: null, 212: null, 213: null, 214: null, 215: null, 216: null, 217: null, 218: null, 219: null, 220: null, 221: null, 222: null, 223: null, 224: null, 225: null, 226: null, 227: null, 228: null, 229: null, 230: null, 231: null, 232: null, 233: null, 234: null, 235: null, 236: null, 237: null, 238: null, 239: null, 240: null, 241: null, 242: null, 243: null, 244: null, 245: null, 246: null, 247: null, 248: null, 249: null, 250: null, 251: null, 252: null, 253: null, 254: null, 255: null,
length: 0,
assign: function assign(index, element) {
if (index < this.length)
this[index] = element;
return element
},
at: function at(index) {
return index > this.length ? VOID : this[index]
},
includes: function includes(element) {
return VOID !== this.index(element)
},
index: function index(element) {
for (var index = this.length; index; )
if (element === this[--index]) return index;
return VOID
},
pop: function pop() {
return 0 === this.length ? VOID : this[--this.length]
},
push: function push(elements) {
if (Constant.MAXIMUM_STATIC_ARRAY_LENGTH < arguments.length + this.length)
return this.length;
// ...
for (var index = arguments.length; index--; )
this[index + this.length] = arguments[index];
return (this.length += arguments.length)
},
splice: function splice(index, elements) /* ->> Expects `index <= this.length` */ {
if (Constant.MAXIMUM_STATIC_ARRAY_LENGTH >= arguments.length + this.length) {
arguments.length -= 1;
for (var start = this.length, end = start + arguments.length; index !== start--; )
this[--end] = this[start];
index += arguments.length;
this.length += arguments.length;
while (arguments.length)
this[--index] = arguments[arguments.length--]
}
return this
}
};
/* Assertion Error */
function AssertionError(message, name) {
return new Error("Assertion failed" + (arguments.length > 0 ? ": " + message : ""), arguments.length > 1 ? name : "AssertionError")
}
/* CSS Selector Descriptor */
function CSSSelectorDescriptor(source) {
this.attributes = new DepthArray;
this.classList = new DepthArray;
this.source = source
}
CSSSelectorDescriptor.prototype = {
attributes: new StaticArray,
classList : new StaticArray,
id : null,
source : "",
tagName : null
};
/* Depth Array ->> Alternative to `class StaticArray` for variable length beyond `Constant.MAXIMUM_STATIC_ARRAY_LENGTH` */
function DepthArray(elements) {
for (var length = arguments.length, index = 0; index !== length; ++index)
this.push(arguments[index]) // ->> Assumed `Constant.MAXIMUM_DEPTH_ARRAY_LENGTH > 1`
}
DepthArray.prototype = {
0: null, 1: null, 2: null, 3: null, 4: null, 5: null, 6: null, 7: null, 8: null, 9: null, 10: null, 11: null, 12: null, 13: null, 14: null, 15: null, 16: null, 17: null, 18: null, 19: null, 20: null, 21: null, 22: null, 23: null, 24: null, 25: null, 26: null, 27: null, 28: null, 29: null, 30: null, 31: null, 32: null, 33: null, 34: null, 35: null, 36: null, 37: null, 38: null, 39: null, 40: null, 41: null, 42: null, 43: null, 44: null, 45: null, 46: null, 47: null, 48: null, 49: null, 50: null, 51: null, 52: null, 53: null, 54: null, 55: null, 56: null, 57: null, 58: null, 59: null, 60: null, 61: null, 62: null, 63: null, 64: null, 65: null, 66: null, 67: null, 68: null, 69: null, 70: null, 71: null, 72: null, 73: null, 74: null, 75: null, 76: null, 77: null, 78: null, 79: null, 80: null, 81: null, 82: null, 83: null, 84: null, 85: null, 86: null, 87: null, 88: null, 89: null, 90: null, 91: null, 92: null, 93: null, 94: null, 95: null, 96: null, 97: null, 98: null, 99: null, 100: null, 101: null, 102: null, 103: null, 104: null, 105: null, 106: null, 107: null, 108: null, 109: null, 110: null, 111: null, 112: null, 113: null, 114: null, 115: null, 116: null, 117: null, 118: null, 119: null, 120: null, 121: null, 122: null, 123: null, 124: null, 125: null, 126: null, 127: null, 128: null, 129: null, 130: null, 131: null, 132: null, 133: null, 134: null, 135: null, 136: null, 137: null, 138: null, 139: null, 140: null, 141: null, 142: null, 143: null, 144: null, 145: null, 146: null, 147: null, 148: null, 149: null, 150: null, 151: null, 152: null, 153: null, 154: null, 155: null, 156: null, 157: null, 158: null, 159: null, 160: null, 161: null, 162: null, 163: null, 164: null, 165: null, 166: null, 167: null, 168: null, 169: null, 170: null, 171: null, 172: null, 173: null, 174: null, 175: null, 176: null, 177: null, 178: null, 179: null, 180: null, 181: null, 182: null, 183: null, 184: null, 185: null, 186: null, 187: null, 188: null, 189: null, 190: null, 191: null, 192: null, 193: null, 194: null, 195: null, 196: null, 197: null, 198: null, 199: null, 200: null, 201: null, 202: null, 203: null, 204: null, 205: null, 206: null, 207: null, 208: null, 209: null, 210: null, 211: null, 212: null, 213: null, 214: null, 215: null, 216: null, 217: null, 218: null, 219: null, 220: null, 221: null, 222: null, 223: null, 224: null, 225: null, 226: null, 227: null, 228: null, 229: null, 230: null, 231: null, 232: null, 233: null, 234: null, 235: null, 236: null, 237: null, 238: null, 239: null, 240: null, 241: null, 242: null, 243: null, 244: null, 245: null, 246: null, 247: null, 248: null, 249: null, 250: null, 251: null, 252: null, 253: null, 254: null, 255: null,
depth : 0,
length: 0,
parent: null,
assign: function assign(index, element) /* ->> Repeated code: see `DepthArray.prototype.at(…)` */ {
if (index < this.length) {
var array = this;
var capacity = Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
// ...
while (capacity < this.length)
capacity *= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
while (array.depth) {
capacity /= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
array = array[Mathematics.trunc(index / capacity)];
index -= capacity * Mathematics.trunc(index / capacity)
}
array[index] = element
}
return element
},
at: function at(index) /* ->> Repeated code: see `DepthArray.prototype.assign(…)` */ {
if (index > this.length) return VOID;
var array = this;
var capacity = Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
// ...
while (capacity < this.length)
capacity *= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
while (array.depth) {
capacity /= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
array = array[Mathematics.trunc(index / capacity)];
index -= capacity * Mathematics.trunc(index / capacity)
}
return array[index]
},
includes: function includes(element) {
return VOID !== this.index(element)
},
index: function index(element) {
for (var index = this.length; index; )
if (element === this.at(--index)) return index;
return VOID
},
pop: function pop() {
if (0 === this.length) return VOID;
if (Constant.MAXIMUM_DEPTH_ARRAY_LENGTH > this.length) return this[--this.length];
/* ... */
var array = this;
var capacity = Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
var element = VOID;
// ...
while (capacity < this.length)
capacity *= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
if (this.length - (capacity / Constant.MAXIMUM_DEPTH_ARRAY_LENGTH) === 1) {
element = this[1];
this.depth -= 1;
this.length -= 1;
for (var depth = element.depth; depth--; ) element = element[0];
for (var index = Constant.MAXIMUM_DEPTH_ARRAY_LENGTH; index--; ) this[index] = this[0][index];
return element[0]
}
for (var depth = this.depth; depth--; ) {
var lastIndex = array.length === capacity ? Constant.MAXIMUM_DEPTH_ARRAY_LENGTH - 1 : -1;
// ...
capacity /= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
lastIndex = lastIndex === -1 ? Mathematics.trunc(array.length / capacity) : lastIndex;
array = array[lastIndex]
}
element = array[array.length - 1]
array[array.length - 1] = VOID;
while (null !== array) {
--array.length;
array = array.parent
}
return element
},
push: function push(elements) {
for (var length = arguments.length, index = 0; index !== length; ++index, ++this.length) {
var array = this;
var capacity = Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
// ...
for (var depth = this.depth; depth--; )
capacity *= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
for (var depth = this.depth; depth--; ) {
var lastIndex = array.length === capacity ? Constant.MAXIMUM_DEPTH_ARRAY_LENGTH - 1 : -1;
// ...
capacity /= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
lastIndex = lastIndex === -1 ? Mathematics.trunc(array.length / capacity) : lastIndex;
if (Constant.MAXIMUM_DEPTH_ARRAY_LENGTH !== lastIndex + 1)
array[lastIndex + 1] = VOID;
if (VOID === array[lastIndex]) {
var subarray = new DepthArray;
subarray[0] = VOID;
subarray.depth = depth;
subarray.parent = array;
array[lastIndex] = subarray
}
array = array[lastIndex]
}
if (Constant.MAXIMUM_DEPTH_ARRAY_LENGTH === array.length) {
var full = false;
var subarray = new DepthArray;
// ...
capacity = Constant.MAXIMUM_DEPTH_ARRAY_LENGTH;
while (capacity === array.length) {
if (this === array) { full = true; break }
array = array.parent;
capacity *= Constant.MAXIMUM_DEPTH_ARRAY_LENGTH
}
if (full) {
array = new DepthArray;
array.depth = subarray.depth = this.depth;
array.parent = subarray.parent = this;
subarray.length = this.length;
for (var subindex = Constant.MAXIMUM_DEPTH_ARRAY_LENGTH; subindex--; )
subarray[subindex] = this[subindex];
this[0] = subarray;
this[1] = array;
++this.depth;
for (var depth = this.depth; --depth; ) {
subarray = new DepthArray;
subarray.depth = array.depth - 1;
subarray.parent = array;
array[0] = subarray;
array = subarray
}
}
}
if (Constant.MAXIMUM_DEPTH_ARRAY_LENGTH !== array.length + 1) array[array.length + 1] = VOID;
for (array[array.length] = arguments[index]; this !== array; array = array.parent) ++array.length
}
return this.length
},
splice: function splice(index, elements) /* ->> Expects `index <= this.length` */ {
arguments.length -= 1;
index += arguments.length;
for (var count = arguments.length, subindex = this.length - count; count; --count, ++subindex)
this.push(this.at(subindex));
for (var subindex = this.length - arguments.length; index <= subindex; --subindex)
this.assign(subindex, this.at(subindex - arguments.length));
while (arguments.length)
this.assign(--index, arguments[arguments.length--]);
return this
}
};
/* DOM Tree */
function DOMTree() {}
DOMTree.prototype = DepthArray.prototype;
/* Error ->> Abstraction wrapper over `class Error` */
function Error(message, name) {
return new TypeError(message, arguments.length > 1 ? name : "Error")
}
/* Fraction */
function Fraction(whole, numerator, denominator) {
this.denominator = denominator;
this.numerator = numerator;
this.whole = whole
}
Fraction.prototype = {
denominator: 0,
numerator : 0,
whole : 0,
toImproper: function toImproper() {
this.numerator += this.denominator * this.whole;
this.whole = 0;
return this
},
toMixed: function toMixed() {
if (0 === this.whole) {
var fraction = Functions.numberToFraction(this.numerator / this.denominator);
this.denominator = fraction.denominator;
this.numerator = fraction.numerator;
this.whole = fraction.whole
}
return this
}
};
/* Pseudo ->> Dummy class type for specific native validations */
function Pseudo() {}
/* Pseudo Error ->> Dummy exception for triggering `catch` blocks only */
function PseudoError() {
return ERROR
}
PseudoError.prototype = {
message: "",
name : "Error"
};
/* Native Assertion Error ->> `nativeof(…)` exception */
function NativeAssertionError(message, name) {
return new Error(message, arguments.length > 1 ? name : "NativeAssertionError")
}
/* Native Assertion Promise ->> `nativeof(…)` evaluation */
function NativeAssertionPromise(object, key, options, name) {
this.object = object;
this.objectName = name;
this.options = options;
this.propertyKey = key
}
NativeAssertionPromise.prototype = {
native : VOID,
object : VOID,
objectName : null,
onerror : function onerror(object, key, options, native) { return ERROR },
onfail : null,
onpass : null,
options : 0x0000000,
propertyKey: null,
"catch": (function() {
// ... ->> Strictly compare function `source` to its native defaults
function isNativeFunctionSource(promise, source) {
for (var index = Constant.NATIVE_FUNCTION_SOURCE.length; index; ) {
var nativeSource = Constant.NATIVE_FUNCTION_SOURCE[--index].toString();
if ( // ->> Expects `promise.options & (Enumeration.NAMED_FUNCTION | Enumeration.UNNAMED_FUNCTION)`
(((promise.options & Enumeration.UNNAMED_FUNCTION) || false == (promise.options & Enumeration.NAMED_FUNCTION)) && (
source === "function() { " + nativeSource + " }" ||
source === "function() {\n " + nativeSource + "\n}" ||
source === "\nfunction() {\n " + nativeSource + "\n}\n"
)) ||
(((promise.options & Enumeration.NAMED_FUNCTION) || false == (promise.options & Enumeration.UNNAMED_FUNCTION)) && (
source === "function " + promise.propertyKey + "() { " + nativeSource + " }" ||
source === "function " + promise.propertyKey + "() {\n " + nativeSource + "\n}" ||
source === "\nfunction " + promise.propertyKey + "() {\n " + nativeSource + "\n}\n"
))
) return true
}
return false
}
// ...
return function(handler) {
this.onfail = handler;
try { this.native = this.onpass(this.object, this.propertyKey, this.options, this.native) }
catch (error) { this.native = ERROR }
this.onpass = null;
// ... ->> `NativeAssertionPromise::onpass(…)` failed
if (ERROR === this.native)
return this["throw"]();
// ... ->> Sloppy native assertion
if (false === (
((this.options & Enumeration.AS_BIGINT) && ("bigint" === typeof this.native)) ||
((this.options & Enumeration.AS_BOOLEAN) && ("boolean" === typeof this.native)) ||
((this.options & Enumeration.AS_CLASS_FUNCTION) && ("function" === typeof this.native)) ||
((this.options & Enumeration.AS_DATE) && ("date" === typeof this.native)) ||
((this.options & Enumeration.AS_FUNCTION) && ("function" === typeof this.native)) ||
((this.options & Enumeration.AS_GENERATOR_FUNCTION) && ("function" === typeof this.native)) ||
((this.options & Enumeration.AS_GETTER_FUNCTION) && ("function" === typeof this.native)) ||
((this.options & Enumeration.AS_NUMBER) && ("number" === typeof this.native)) ||
((this.options & Enumeration.AS_OBJECT) && ("object" === typeof this.native && null !== this.native)) ||
((this.options & Enumeration.AS_OBJECT_FUNCTION) && ("function" === typeof this.native || "object" === typeof this.native)) ||
((this.options & Enumeration.AS_SETTER_FUNCTION) && ("function" === typeof this.native)) ||
((this.options & Enumeration.AS_STRING) && ("string" === typeof this.native)) ||
((this.options & Enumeration.AS_SYMBOL) && ("symbol" === typeof this.native)) ||
((this.options & Enumeration.AS_UNDEFINED) && ("undefined" === typeof this.native)) ||
((this.options & Enumeration.AS_UNKNOWN) && ("unknown" === typeof this.native)) ||
((this.options & Enumeration.AS_NULL) && null === this.native) ||
((this.options & Enumeration.AS_PROPERTY) && false === this.propertyKey in this.object)
)) return this["throw"]();
// ... ->> Strict native assertion
if (this.options & Enumeration.STRICT) {
// ... ->> Assert property descriptor
if (this.options & (Enumeration.CONFIGURABLE_PROPERTY | Enumeration.ENUMERABLE_PROPERTY | Enumeration.GETTER_PROPERTY | Enumeration.OWN_PROPERTY | Enumeration.SETTER_PROPERTY | Enumeration.VALUE_PROPERTY | Enumeration.WRITABLE_PROPERTY)) {
var descriptor = Functions.describeProperty(this.object, this.propertyKey);
if (
((this.options & Enumeration.CONFIGURABLE_PROPERTY) && (VOID === descriptor.configurable || false === descriptor.configurable)) ||
((this.options & Enumeration.ENUMERABLE_PROPERTY) && (VOID === descriptor.enumerable || false === descriptor.enumerable)) ||
((this.options & Enumeration.WRITABLE_PROPERTY) && (VOID === descriptor.writable || false === descriptor.writable)) ||
((this.options & Enumeration.GETTER_PROPERTY) && VOID === descriptor.get) ||
((this.options & Enumeration.SETTER_PROPERTY) && VOID === descriptor.set) ||
((this.options & Enumeration.VALUE_PROPERTY) && VOID === descriptor.value) ||
((this.options & Enumeration.OWN_PROPERTY) && false === descriptor.own)
) return this["throw"]()
}
// ... ->> Assert as built-in native
if (this.options & (Enumeration.AS_CLASS_FUNCTION | Enumeration.AS_FUNCTION | Enumeration.AS_GENERATOR_FUNCTION | Enumeration.AS_GETTER_FUNCTION | Enumeration.AS_OBJECT_FUNCTION | Enumeration.AS_SETTER_FUNCTION)) {
var prototyped = false;
var source = null;
// ... ->> Fails in non-standard JavaScript implementations that have built-in functions with the `prototype` property
try {
// ... --> Proxy::deleteProperty(…), Proxy::has(…)
if (this.options & (Enumeration.AS_CLASS_FUNCTION | Enumeration.AS_FUNCTION | Enumeration.AS_GENERATOR_FUNCTION | Enumeration.AS_OBJECT_FUNCTION))
if ("prototype" in this.native || false === delete this.native["prototype"]) throw new PseudoError()
} catch (error) { prototyped = true }
if (prototyped)
return this["throw"]();
// ... ->> Function name assertion
if ((this.options & Enumeration.NAMED_FUNCTION) && Support.FUNCTION_INHERITS_NAME_PROPERTY) {
var removed = false;
var renamed = false;
// ...
try { this.native.name = ERROR }
catch (error) { renamed = false === delete this.native["name"]; removed = true }
renamed = renamed || (false === removed && this.native.name !== this.propertyKey);
if (renamed) return this["throw"]()
}
// ... ->> Function source assertion
if (
VOID !== Native.Function$prototype$apply && VOID !== Native.Function$prototype$toString &&
false === (this.propertyKey === "apply" && (this.object === Native.Function$prototype || this.object === Native.Function$prototype$apply))
) {
if (VOID !== Native.Function$prototype$bind)
// ... --> Function.prototype.apply.bind(Function.prototype.apply)(Function.prototype.toString, […])
source = Native.Function$prototype$apply(Native.Function$prototype$toString, [this.native]);
else if (assert(Native.Function$prototype$apply, Enumeration.STRICT)) {
// ... --> Function.prototype.apply.apply(Function.prototype.toString, […])
source = Native.Function$prototype$apply.apply(Native.Function$prototype$toString, [this.native]);
if ("string" !== typeof source || source.length < Mathematics.max(Constant.NATIVE_FUNCTION_SOURCE[0], Constant.NATIVE_FUNCTION_SOURCE[1] /* , … */) + (
this.options & Enumeration.AS_CLASS_FUNCTION ? "class{}" .length + (this.options & Enumeration.NAMED_FUNCTION ? this.propertyKey.length + ' '.length : 0) :
this.options & Enumeration.AS_GENERATOR_FUNCTION ? "function*(){}".length + (this.options & Enumeration.NAMED_FUNCTION ? this.propertyKey.length + ' '.length : 0) :
this.options & Enumeration.AS_GETTER_FUNCTION ? "get _(){}" .length + (this.options & Enumeration.NAMED_FUNCTION ? this.propertyKey.length - '_'.length : 0) :
this.options & Enumeration.AS_OBJECT_FUNCTION ? "function(){}" .length + (this.options & Enumeration.NAMED_FUNCTION ? this.propertyKey.length + ' '.length : 0) :
this.options & Enumeration.AS_SETTER_FUNCTION ? "set _(){}" .length + (this.options & Enumeration.NAMED_FUNCTION ? this.propertyKey.length - '_'.length : 0) :
this.options & Enumeration.AS_FUNCTION ? 13 : 0
)) throw new NativeAssertionError("Unable to evaluate `Function.prototype.apply(\u2026)` as built-in native")
}
else
return this["throw"]();
// ... ->> Programmatically compare function source to its native defaults
if (false === isNativeFunctionSource(this, source)) {
var delimiters = new DepthArray();
var match = false;
// ...
if (assert(Functions.stringAt, Enumeration.STRICT)) {
// ... ->> Inspect the source of the function head
if (this.options & (Enumeration.NAMED_FUNCTION | Enumeration.UNNAMED_FUNCTION)) {
var declarators = [
new StaticString('c', 'l', 'a', 's', 's'),
new StaticString('f', 'u', 'n', 'c', 't', 'i', 'o', 'n'),
new StaticString('g', 'e', 't'),
new StaticString('s', 'e', 't')
];
// ...
parse_head:
for (var declaratorsIndex = declarators.length; declaratorsIndex; ) {
var declarator = declarators[--declaratorsIndex];
var declaratorOffset = 0;
var sourceOffset = 0;
// ...
while (Functions.stringAt(source, sourceOffset++) === declarator[declaratorOffset++]) {
// ... ->> Source substring match found for `declarator`
if (declaratorOffset === declarator.length) {
var commentMatch = false; // ->> Ignore multi-line comment
var name = ["", ""]; // ->> `name[0]` is the (trimmed) function name; `name[1]` is the trimmed whitespace
var generatorDeclaratorMatch = false; // ->> Note generator function declarator
// ... ->> Ensure `declarator` matches expected function source
if (this.options & Enumeration.AS_FUNCTION) { if (declarator.toString() !== "class" && declarator.toString() !== "function" && declarator.toString() !== "get" && declarator.toString() !== "set") break }
else if (this.options & Enumeration.AS_CLASS_FUNCTION) { if (declarator.toString() !== "class") break }
else if (this.options & Enumeration.AS_GETTER_FUNCTION) { if (declarator.toString() !== "get") break }
else if (this.options & Enumeration.AS_SETTER_FUNCTION) { if (declarator.toString() !== "set") break }
else if (this.options & (Enumeration.AS_GENERATOR_FUNCTION | Enumeration.AS_OBJECT_FUNCTION)) { if (declarator.toString() !== "function") break }
// ... ->> Parse source of the function name
for (var sourceIndex = sourceOffset; sourceIndex !== source.length; ++sourceIndex) {
var character = Functions.stringAt(source, sourceIndex);
// ... ->> Ignore multi-line comment
if (commentMatch) { commentMatch = false === (character === '*' && Functions.stringAt(source, sourceIndex + 1) === '/'); continue }
if (character === '/' && Functions.stringAt(source, sourceIndex + 1) === '*') { commentMatch = true; continue }
// ... ->> Note generator function declarator
if (character === '*') {
if (generatorDeclaratorMatch || false === (this.options & (Enumeration.AS_FUNCTION | Enumeration.AS_GENERATOR_FUNCTION))) break;
generatorDeclaratorMatch = true
}
// ... ->> Found function parameter list declarator
if (character === '(') {
match = (this.options & Enumeration.NAMED_FUNCTION) && (this.options & Enumeration.UNNAMED_FUNCTION)
? name[0] === this.propertyKey || "" === name[0]
: name[0] === (this.options & Enumeration.NAMED_FUNCTION ? this.propertyKey : "");
break parse_head
}
// ...
if (Functions.stringIsWhitespace(character)) name[1] += "" === name[0] ? "" : character;
else { name[0] += name[1] + character; name[1] = "" }
}
break
}
// ...
if (sourceOffset === source.length)
break
}
}
if (false === match)
return this["throw"]()
}
// ... ->> Inspect the source of the function body
parse_body:
for (var sourceIndex = 0; sourceIndex !== source.length; ++sourceIndex) {
var character = Functions.stringAt(source, sourceIndex);
var delimiter = delimiters.length ? delimiters.at(0) : null;
// ...
do {
// ... ->> Ignore multi-line comments or string literals
switch (delimiter) {
case '\"': case '\'': if (character !== delimiter) continue parse_body; break;
case '/': if (character !== '*' || Functions.stringAt(source, sourceIndex + 1) !== '/') continue parse_body
}
// ... ->> Note delimiter starts (and ends)
switch (character) {
case '(': delimiters.splice(0, delimiter = '('); continue;
case '[': delimiters.splice(0, delimiter = '['); continue;
case '{': delimiters.splice(0, delimiter = '{'); continue;
case '/': if (Functions.stringAt(source, sourceIndex + 1) === '*') delimiters.splice(0, delimiter = '/'); continue;
case '*': if (Functions.stringAt(source, sourceIndex + 1) !== '/') continue; break;
case '\"': case '\'': if (character !== delimiter) { delimiters.splice(0, character); continue } break;
case ')': case ']': case '}': if ((character !== ')' || delimiter !== '(') && (character !== ']' || delimiter !== '[') && (character !== '}' || delimiter !== '{')) continue; break;
default: continue
}
// ... ->> Note delimiter ends
for (var length = delimiters.length, index = 1; index < length; ++index)
delimiters.assign(index - 1, delimiters.at(index - 0));
delimiters.pop()
} while (false);
// ... ->> Source substring match found for native function source
for (var nativeSourcesIndex = Constant.NATIVE_FUNCTION_SOURCE.length; nativeSourcesIndex; ) {
var nativeSource = Constant.NATIVE_FUNCTION_SOURCE[--nativeSourcesIndex];
var nativeSourceOffset = 0;
var sourceOffset = sourceIndex;
// ...
while (Functions.stringAt(source, sourceOffset++) === nativeSource[nativeSourceOffset++]) {
if (nativeSourceOffset === nativeSource.length)
if (delimiter === '[') {
match = true;
break parse_body
}
// ...
if (sourceOffset === source.length)
break
}
}
}
}
if (false === match)
return this["throw"]()
}
}
else if ("toString" in Native.Function$prototype && "toString" in Native.Object$prototype) {
var Function$prototype$toString = VOID !== Native.Function$prototype$toString ? this.object === Native.Function$prototype && this.propertyKey === "toString" ? this.native : Native.Function$prototype$toString : /* ->> unexpected */ Native.Function$prototype.toString; // --> Function.prototype.toString(…)
// ...
if (false === (delete Native.Function$prototype["toString"] && delete Native.Object$prototype["toString"] && delete this.native["toString"])) {
Native.Function$prototype.toString = Function$prototype$toString;
Native.Object$prototype .toString = Native.Object$prototype$toString$;
return this["throw"]()
}
Native.Function$prototype.toString = Function$prototype$toString;
try { source = this.native.toString() } catch (error) {}
Native.Object$prototype.toString = Native.Object$prototype$toString$;
if (false === isNativeFunctionSource(this, source)) return this["throw"]()
}
else
// ... ->> Could not acquire function source
return this["throw"]()
}
}
// ... ->> Primed for calls to only `NativeAssertionPromise.prototype.finally(…)`, `NativeAssertionPromise.prototype.throw(…)`, and `NativeAssertionPromise.prototype.valueOf(…)`
this["catch"] = null;
this["get"] = null;
this["try"] = null;
return this
}
})(),
"finally": function(handler) {
var value = ERROR;
// ...
if (null === handler) value = ERROR === this.native ? VOID : this.native;
else try { value = handler(this.native) } catch (error) {}
if (ERROR === value) {
this.onfail = this.onerror;
return this["throw"]()
}
// ... ->> Primed for no more `nativeof(…)` method calls
this["finally"] = null;
this["onfail"] = null;
this["throw"] = null;
this["valueOf"] = null;
return value
},
get: function get(handler) {
if (null === this.onpass) {
if (null === handler) return this["try"](null)["catch"](null);
return this["try"](arguments.length ? handler : this.valueOf)["catch"](this.onerror)
}
throw new NativeAssertionError("Encountered invalid use of `nativeof(\u2026)` assertion")
},
"throw": function() {
if (null === this.onfail)
this.native = ERROR;
else if (ERROR === this.onfail(this.object, this.propertyKey, this.options, this.native)) {
this.native = ERROR;
throw new NativeAssertionError("Unable to evaluate " + ("symbol" !== typeof this.propertyKey ? '`' + (null !== this.objectName ? this.objectName + '.' : "") + this.propertyKey + (
(this.options & (Enumeration.AS_CLASS_FUNCTION | Enumeration.AS_FUNCTION | Enumeration.AS_GENERATOR_FUNCTION | Enumeration.AS_GETTER_FUNCTION | Enumeration.AS_OBJECT_FUNCTION | Enumeration.AS_SETTER_FUNCTION)) &&
false == (this.options & (Enumeration.AS_BIGINT | Enumeration.AS_BOOLEAN | Enumeration.AS_NUMBER | Enumeration.AS_NULL | Enumeration.AS_OBJECT | Enumeration.AS_STRING | Enumeration.AS_SYMBOL | Enumeration.AS_UNDEFINED)) ? "()" : ""
) + '`' : "feature") + " as built-in native")
}
// ...
return this
},
"try": function(handler) {
if (null === this.onpass) {
this.onpass = null === handler ? this.valueOf : handler;
return this
}
throw new NativeAssertionError("Encountered invalid use of `nativeof(\u2026)` assertion")
},
valueOf: function valueOf(/* object, key */) {
if (VOID === this.native) {
var key = arguments[1];
var object = arguments[0];
// ...
if (null !== object && undefined !== object)
try {
if (
"bigint" === typeof object ||
"boolean" === typeof object ||
"number" === typeof object ||
"string" === typeof object ||
"symbol" === typeof object ||
key in object // --> Proxy::has(…)
) return object[key] // --> Proxy::get(…)
} catch (error) {}
return ERROR
}
return this.native
}
};
/* Property Descriptor */
function PropertyDescriptor() {
this.own = true
}
PropertyDescriptor.prototype = {
configurable: VOID,
enumerable : VOID,
get : VOID,
own : false,
set : VOID,
value : VOID,
writable : VOID
};
/* Recursion Overflow Error ->> Abstraction wrapper over `class InternalError` or `class RangeError` */
function RecursionOverflowError(message, name) {
ERROR = RECURSION_OVERFLOW_ERROR;
if (VOID === RECURSION_OVERFLOW_ERROR) {
try { ERROR = new RecursionOverflowError(arguments.length ? message : "") }
catch (error) { ERROR = error }
}
ERROR.message = arguments.length ? message : "";
if ("description" in ERROR && false === "description" in Native.RecursionOverflowError$prototype) ERROR.description = ERROR.message;
if (RECURSION_OVERFLOW_ERROR === RecursionOverflowError.prototype) ERROR.name = arguments.length > 1 ? name : ERROR.name;
return (RECURSION_OVERFLOW_ERROR = ERROR)
}
/* Reference Error ->> Abstraction Wrapper over `class ReferenceError` */
function ReferenceError(message, name) {
ERROR = REFERENCE_ERROR;
if (VOID === REFERENCE_ERROR) {
try { ㅤ } // ->> Identifier must be non-deducible and non-defined
catch (error) { ERROR = error }
}
ERROR.message = arguments.length ? message : "";
if ("description" in ERROR && false === "description" in Native.ReferenceError$prototype) ERROR.description = ERROR.message;
if (REFERENCE_ERROR === ReferenceError.prototype) ERROR.name = arguments.length > 1 ? name : ERROR.name;
return (REFERENCE_ERROR = ERROR)
}
/* Static String ->> String alternative before evaluating `String.prototype.charAt(…)` */
function StaticString(characters) {
var string = "";
// ...
this.length = arguments.length;
this.toString = function toString() { return string };
while (arguments.length--) /* ->> Assumed `arguments.length < 256` */ {
string = arguments[arguments.length] + string;
this[arguments.length] = arguments[arguments.length]
}
}
StaticString.prototype = {
0: null, 1: null, 2: null, 3: null, 4: null, 5: null, 6: null, 7: null, 8: null, 9: null, 10: null, 11: null, 12: null, 13: null, 14: null, 15: null, 16: null, 17: null, 18: null, 19: null, 20: null, 21: null, 22: null, 23: null, 24: null, 25: null, 26: null, 27: null, 28: null, 29: null, 30: null, 31: null, 32: null, 33: null, 34: null, 35: null, 36: null, 37: null, 38: null, 39: null, 40: null, 41: null, 42: null, 43: null, 44: null, 45: null, 46: null, 47: null, 48: null, 49: null, 50: null, 51: null, 52: null, 53: null, 54: null, 55: null, 56: null, 57: null, 58: null, 59: null, 60: null, 61: null, 62: null, 63: null, 64: null, 65: null, 66: null, 67: null, 68: null, 69: null, 70: null, 71: null, 72: null, 73: null, 74: null, 75: null, 76: null, 77: null, 78: null, 79: null, 80: null, 81: null, 82: null, 83: null, 84: null, 85: null, 86: null, 87: null, 88: null, 89: null, 90: null, 91: null, 92: null, 93: null, 94: null, 95: null, 96: null, 97: null, 98: null, 99: null, 100: null, 101: null, 102: null, 103: null, 104: null, 105: null, 106: null, 107: null, 108: null, 109: null, 110: null, 111: null, 112: null, 113: null, 114: null, 115: null, 116: null, 117: null, 118: null, 119: null, 120: null, 121: null, 122: null, 123: null, 124: null, 125: null, 126: null, 127: null, 128: null, 129: null, 130: null, 131: null, 132: null, 133: null, 134: null, 135: null, 136: null, 137: null, 138: null, 139: null, 140: null, 141: null, 142: null, 143: null, 144: null, 145: null, 146: null, 147: null, 148: null, 149: null, 150: null, 151: null, 152: null, 153: null, 154: null, 155: null, 156: null, 157: null, 158: null, 159: null, 160: null, 161: null, 162: null, 163: null, 164: null, 165: null, 166: null, 167: null, 168: null, 169: null, 170: null, 171: null, 172: null, 173: null, 174: null, 175: null, 176: null, 177: null, 178: null, 179: null, 180: null, 181: null, 182: null, 183: null, 184: null, 185: null, 186: null, 187: null, 188: null, 189: null, 190: null, 191: null, 192: null, 193: null, 194: null, 195: null, 196: null, 197: null, 198: null, 199: null, 200: null, 201: null, 202: null, 203: null, 204: null, 205: null, 206: null, 207: null, 208: null, 209: null, 210: null, 211: null, 212: null, 213: null, 214: null, 215: null, 216: null, 217: null, 218: null, 219: null, 220: null, 221: null, 222: null, 223: null, 224: null, 225: null, 226: null, 227: null, 228: null, 229: null, 230: null, 231: null, 232: null, 233: null, 234: null, 235: null, 236: null, 237: null, 238: null, 239: null, 240: null, 241: null, 242: null, 243: null, 244: null, 245: null, 246: null, 247: null, 248: null, 249: null, 250: null, 251: null, 252: null, 253: null, 254: null, 255: null,
length: 0,
toString: function toString() {
var string = "";
// ...
for (var index = this.length; index; )
string = this[--index] + string;
return string
}
};
/* Type Error ->> Abstraction wrapper over `class TypeError` */
function TypeError(message, name) {
ERROR = TYPE_ERROR;
if (VOID === TYPE_ERROR) {
try { null() }
catch (error) { ERROR = error }
}
ERROR.message = arguments.length ? message : "";
if ("description" in ERROR && false === "description" in Native.TypeError$prototype) ERROR.description = ERROR.message;
if (TYPE_ERROR === TypeError.prototype) ERROR.name = arguments.length > 1 ? name : ERROR.name;
return (TYPE_ERROR = ERROR)
}
/* Unreachable State Error */
function UnreachableStateError(debug) {
if (null !== debug) debugger;
return new RecursionOverflowError("Unexpected state reached", "UnreachableStateError")
}
/* Namespace */
/* Constant */
var Constant = {
DEPTH_ARRAY_MAXIMUM : VOID,
MAXIMUM_BITWISE_INTEGER : VOID,
MAXIMUM_DEPTH_ARRAY_LENGTH : VOID,
MAXIMUM_NUMBER : VOID,
MAXIMUM_SAFE_INTEGER : VOID,
MAXIMUM_STATIC_ARRAY_LENGTH : VOID,
MAXIMUM_STATIC_STRING_LENGTH: VOID,
NATIVE_FUNCTION_SOURCE : VOID
};
/* Enumerations ->> Configuration constants */
var Enumeration = {
STRICT : 0x0000001,
AS_BIGINT : 0x0000002,
AS_BOOLEAN : 0x0000004,
AS_CLASS_FUNCTION : 0x0000008,
AS_DATE : 0x0000010, // ->> Internet Explorer only
AS_FUNCTION : 0x0000020,
AS_GENERATOR_FUNCTION: 0x0000040,
AS_GETTER_FUNCTION : 0x0000080,
AS_NULL : 0x0000100,
AS_NUMBER : 0x0000200,
AS_OBJECT : 0x0000400,
AS_OBJECT_FUNCTION : 0x0000800, // ->> Internet Explorer 8 and before --> ; MSIE 8.×;
AS_PROPERTY : 0x0001000,
AS_SETTER_FUNCTION : 0x0002000,
AS_STRING : 0x0004000,
AS_SYMBOL : 0x0008000,
AS_UNDEFINED : 0x0010000,
AS_UNKNOWN : 0x0020000, // ->> Internet Explorer only
NAMED_FUNCTION : 0x0040000,
UNNAMED_FUNCTION : 0x0080000,
CONFIGURABLE_PROPERTY: 0x0100000,
ENUMERABLE_PROPERTY : 0x0200000,
GETTER_PROPERTY : 0x0400000,
OWN_PROPERTY : 0x0800000,
SETTER_PROPERTY : 0x1000000,
WRITABLE_PROPERTY : 0x2000000,
VALUE_PROPERTY : 0x4000000
};
/* Functions ->> Convenience/ validated abstractions over native features */
var Functions = {
defineProperty : VOID,
describeProperty : VOID,
describeSelector : VOID,