@@ -413,7 +413,7 @@ class Interface {
413
413
value: function next() {
414
414
const internal = this[utils.iterInternalSymbol];
415
415
const { target, kind, index } = internal;
416
- const values = Array.from(target[impl ]);
416
+ const values = Array.from(target[implSymbol ]);
417
417
const len = values.length;
418
418
if (index >= len) {
419
419
return { value: undefined, done: true };
@@ -492,8 +492,8 @@ class Interface {
492
492
}
493
493
494
494
generateRequires ( ) {
495
- this . requires . addRaw ( "impl " , "utils.implSymbol" ) ;
496
- this . requires . addRaw ( "ctorRegistry " , "utils.ctorRegistrySymbol" ) ;
495
+ this . requires . addRaw ( "implSymbol " , "utils.implSymbol" ) ;
496
+ this . requires . addRaw ( "ctorRegistrySymbol " , "utils.ctorRegistrySymbol" ) ;
497
497
498
498
if ( this . idl . inheritance !== null ) {
499
499
this . requires . addRelative ( this . idl . inheritance ) ;
@@ -509,7 +509,7 @@ class Interface {
509
509
generateExport ( ) {
510
510
this . str += `
511
511
exports.is = function is(obj) {
512
- return utils.isObject(obj) && utils.hasOwn(obj, impl ) && obj[impl ] instanceof Impl.implementation;
512
+ return utils.isObject(obj) && utils.hasOwn(obj, implSymbol ) && obj[implSymbol ] instanceof Impl.implementation;
513
513
};
514
514
exports.isImpl = function isImpl(obj) {
515
515
return utils.isObject(obj) && obj instanceof Impl.implementation;
@@ -549,10 +549,10 @@ class Interface {
549
549
}
550
550
if ( unsupportedValue ) {
551
551
const func = this . indexedGetter . name ? `.${ this . indexedGetter . name } ` : "[utils.indexedGet]" ;
552
- const value = indexedValue || `${ O } [impl ]${ func } (${ index } )` ;
552
+ const value = indexedValue || `${ O } [implSymbol ]${ func } (${ index } )` ;
553
553
return `${ value } !== ${ unsupportedValue } ` ;
554
554
}
555
- return `${ O } [impl ][utils.supportsPropertyIndex](${ index } )` ;
555
+ return `${ O } [implSymbol ][utils.supportsPropertyIndex](${ index } )` ;
556
556
} ;
557
557
558
558
const supportsPropertyName = ( O , P , namedValue ) => {
@@ -562,10 +562,10 @@ class Interface {
562
562
}
563
563
if ( unsupportedValue ) {
564
564
const func = this . namedGetter . name ? `.${ this . namedGetter . name } ` : "[utils.namedGet]" ;
565
- const value = namedValue || `${ O } [impl ]${ func } (${ P } )` ;
565
+ const value = namedValue || `${ O } [implSymbol ]${ func } (${ P } )` ;
566
566
return `${ value } !== ${ unsupportedValue } ` ;
567
567
}
568
- return `${ O } [impl ][utils.supportsPropertyName](${ P } )` ;
568
+ return `${ O } [implSymbol ][utils.supportsPropertyName](${ P } )` ;
569
569
} ;
570
570
571
571
// "named property visibility algorithm"
@@ -603,14 +603,14 @@ class Interface {
603
603
invocation = `
604
604
const creating = !(${ supportsPropertyIndex ( O , "index" ) } );
605
605
if (creating) {
606
- ${ O } [impl ][utils.indexedSetNew](index, indexedValue);
606
+ ${ O } [implSymbol ][utils.indexedSetNew](index, indexedValue);
607
607
} else {
608
- ${ O } [impl ][utils.indexedSetExisting](index, indexedValue);
608
+ ${ O } [implSymbol ][utils.indexedSetExisting](index, indexedValue);
609
609
}
610
610
` ;
611
611
} else {
612
612
invocation = `
613
- ${ O } [impl ].${ this . indexedSetter . name } (index, indexedValue);
613
+ ${ O } [implSymbol ].${ this . indexedSetter . name } (index, indexedValue);
614
614
` ;
615
615
}
616
616
@@ -641,14 +641,14 @@ class Interface {
641
641
invocation = `
642
642
const creating = !(${ supportsPropertyName ( O , P ) } );
643
643
if (creating) {
644
- ${ O } [impl ][utils.namedSetNew](${ P } , namedValue);
644
+ ${ O } [implSymbol ][utils.namedSetNew](${ P } , namedValue);
645
645
} else {
646
- ${ O } [impl ][utils.namedSetExisting](${ P } , namedValue);
646
+ ${ O } [implSymbol ][utils.namedSetExisting](${ P } , namedValue);
647
647
}
648
648
` ;
649
649
} else {
650
650
invocation = `
651
- ${ O } [impl ].${ this . namedSetter . name } (${ P } , namedValue);
651
+ ${ O } [implSymbol ].${ this . namedSetter . name } (${ P } , namedValue);
652
652
` ;
653
653
}
654
654
@@ -729,14 +729,14 @@ class Interface {
729
729
` ;
730
730
if ( this . supportsIndexedProperties ) {
731
731
this . str += `
732
- for (const key of target[impl ][utils.supportedPropertyIndices]) {
732
+ for (const key of target[implSymbol ][utils.supportedPropertyIndices]) {
733
733
keys.add(\`\${key}\`);
734
734
}
735
735
` ;
736
736
}
737
737
if ( this . supportsNamedProperties ) {
738
738
this . str += `
739
- for (const key of target[impl ][utils.supportedPropertyNames]) {
739
+ for (const key of target[implSymbol ][utils.supportedPropertyNames]) {
740
740
if (${ namedPropertyVisible ( "key" , "target" , true ) } ) {
741
741
keys.add(\`\${key}\`);
742
742
}
@@ -769,10 +769,10 @@ class Interface {
769
769
let preamble = "" ;
770
770
let condition ;
771
771
if ( utils . getExtAttr ( this . indexedGetter . extAttrs , "WebIDL2JSValueAsUnsupported" ) ) {
772
- this . str += `const indexedValue = target[impl ]${ func } (index);` ;
772
+ this . str += `const indexedValue = target[implSymbol ]${ func } (index);` ;
773
773
condition = supportsPropertyIndex ( "target" , "index" , "indexedValue" ) ;
774
774
} else {
775
- preamble = `const indexedValue = target[impl ]${ func } (index);` ;
775
+ preamble = `const indexedValue = target[implSymbol ]${ func } (index);` ;
776
776
condition = supportsPropertyIndex ( "target" , "index" ) ;
777
777
}
778
778
@@ -797,13 +797,13 @@ class Interface {
797
797
const conditions = [ ] ;
798
798
if ( utils . getExtAttr ( this . namedGetter . extAttrs , "WebIDL2JSValueAsUnsupported" ) ) {
799
799
this . str += `
800
- const namedValue = target[impl ]${ func } (P);
800
+ const namedValue = target[implSymbol ]${ func } (P);
801
801
` ;
802
802
conditions . push ( supportsPropertyName ( "target" , "index" , "namedValue" ) ) ;
803
803
conditions . push ( namedPropertyVisible ( "P" , "target" , true ) ) ;
804
804
} else {
805
805
preamble = `
806
- const namedValue = target[impl ]${ func } (P);
806
+ const namedValue = target[implSymbol ]${ func } (P);
807
807
` ;
808
808
conditions . push ( namedPropertyVisible ( "P" , "target" , false ) ) ;
809
809
}
@@ -885,10 +885,10 @@ class Interface {
885
885
let preamble = "" ;
886
886
let condition ;
887
887
if ( utils . getExtAttr ( this . indexedGetter . extAttrs , "WebIDL2JSValueAsUnsupported" ) ) {
888
- this . str += `const indexedValue = target[impl ]${ func } (index);` ;
888
+ this . str += `const indexedValue = target[implSymbol ]${ func } (index);` ;
889
889
condition = supportsPropertyIndex ( "target" , "index" , "indexedValue" ) ;
890
890
} else {
891
- preamble = `const indexedValue = target[impl ]${ func } (index);` ;
891
+ preamble = `const indexedValue = target[implSymbol ]${ func } (index);` ;
892
892
condition = supportsPropertyIndex ( "target" , "index" ) ;
893
893
}
894
894
@@ -1070,11 +1070,11 @@ class Interface {
1070
1070
1071
1071
if ( this . namedDeleter . idlType . idlType === "bool" ) {
1072
1072
invocation = `
1073
- return target[impl ]${ func } (P);
1073
+ return target[implSymbol ]${ func } (P);
1074
1074
` ;
1075
1075
} else {
1076
1076
invocation = `
1077
- target[impl ]${ func } (P);
1077
+ target[implSymbol ]${ func } (P);
1078
1078
return true;
1079
1079
` ;
1080
1080
}
@@ -1111,11 +1111,11 @@ class Interface {
1111
1111
generateIface ( ) {
1112
1112
this . str += `
1113
1113
exports.create = function create(globalObject, constructorArgs, privateData) {
1114
- if (globalObject[ctorRegistry ] === undefined) {
1114
+ if (globalObject[ctorRegistrySymbol ] === undefined) {
1115
1115
throw new Error('Internal error: invalid global object');
1116
1116
}
1117
1117
1118
- const ctor = globalObject[ctorRegistry ]["${ this . name } "];
1118
+ const ctor = globalObject[ctorRegistrySymbol ]["${ this . name } "];
1119
1119
if (ctor === undefined) {
1120
1120
throw new Error('Internal error: constructor ${ this . name } is not installed on the passed global object');
1121
1121
}
@@ -1145,7 +1145,7 @@ class Interface {
1145
1145
privateData.wrapper = obj;
1146
1146
1147
1147
exports._internalSetup(obj, globalObject);
1148
- Object.defineProperty(obj, impl , {
1148
+ Object.defineProperty(obj, implSymbol , {
1149
1149
value: new Impl.implementation(globalObject, constructorArgs, privateData),
1150
1150
configurable: true
1151
1151
});
@@ -1171,9 +1171,9 @@ class Interface {
1171
1171
}
1172
1172
1173
1173
this . str += `
1174
- obj[impl ][utils.wrapperSymbol] = obj;
1174
+ obj[implSymbol ][utils.wrapperSymbol] = obj;
1175
1175
if (Impl.init) {
1176
- Impl.init(obj[impl ], privateData);
1176
+ Impl.init(obj[implSymbol ], privateData);
1177
1177
}
1178
1178
return obj;
1179
1179
};
@@ -1467,10 +1467,10 @@ class Interface {
1467
1467
this . generateOffInstanceAfterClass ( ) ;
1468
1468
1469
1469
this . str += `
1470
- if (globalObject[ctorRegistry ] === undefined) {
1471
- globalObject[ctorRegistry ] = Object.create(null);
1470
+ if (globalObject[ctorRegistrySymbol ] === undefined) {
1471
+ globalObject[ctorRegistrySymbol ] = Object.create(null);
1472
1472
}
1473
- globalObject[ctorRegistry ][interfaceName] = ${ name } ;
1473
+ globalObject[ctorRegistrySymbol ][interfaceName] = ${ name } ;
1474
1474
1475
1475
Object.defineProperty(globalObject, interfaceName, {
1476
1476
configurable: true,
0 commit comments