@@ -413,7 +413,7 @@ class Interface {
413413 value: function next() {
414414 const internal = this[utils.iterInternalSymbol];
415415 const { target, kind, index } = internal;
416- const values = Array.from(target[impl ]);
416+ const values = Array.from(target[implSymbol ]);
417417 const len = values.length;
418418 if (index >= len) {
419419 return { value: undefined, done: true };
@@ -492,8 +492,8 @@ class Interface {
492492 }
493493
494494 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" ) ;
497497
498498 if ( this . idl . inheritance !== null ) {
499499 this . requires . addRelative ( this . idl . inheritance ) ;
@@ -509,7 +509,7 @@ class Interface {
509509 generateExport ( ) {
510510 this . str += `
511511 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;
513513 };
514514 exports.isImpl = function isImpl(obj) {
515515 return utils.isObject(obj) && obj instanceof Impl.implementation;
@@ -549,10 +549,10 @@ class Interface {
549549 }
550550 if ( unsupportedValue ) {
551551 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 } )` ;
553553 return `${ value } !== ${ unsupportedValue } ` ;
554554 }
555- return `${ O } [impl ][utils.supportsPropertyIndex](${ index } )` ;
555+ return `${ O } [implSymbol ][utils.supportsPropertyIndex](${ index } )` ;
556556 } ;
557557
558558 const supportsPropertyName = ( O , P , namedValue ) => {
@@ -562,10 +562,10 @@ class Interface {
562562 }
563563 if ( unsupportedValue ) {
564564 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 } )` ;
566566 return `${ value } !== ${ unsupportedValue } ` ;
567567 }
568- return `${ O } [impl ][utils.supportsPropertyName](${ P } )` ;
568+ return `${ O } [implSymbol ][utils.supportsPropertyName](${ P } )` ;
569569 } ;
570570
571571 // "named property visibility algorithm"
@@ -603,14 +603,14 @@ class Interface {
603603 invocation = `
604604 const creating = !(${ supportsPropertyIndex ( O , "index" ) } );
605605 if (creating) {
606- ${ O } [impl ][utils.indexedSetNew](index, indexedValue);
606+ ${ O } [implSymbol ][utils.indexedSetNew](index, indexedValue);
607607 } else {
608- ${ O } [impl ][utils.indexedSetExisting](index, indexedValue);
608+ ${ O } [implSymbol ][utils.indexedSetExisting](index, indexedValue);
609609 }
610610 ` ;
611611 } else {
612612 invocation = `
613- ${ O } [impl ].${ this . indexedSetter . name } (index, indexedValue);
613+ ${ O } [implSymbol ].${ this . indexedSetter . name } (index, indexedValue);
614614 ` ;
615615 }
616616
@@ -641,14 +641,14 @@ class Interface {
641641 invocation = `
642642 const creating = !(${ supportsPropertyName ( O , P ) } );
643643 if (creating) {
644- ${ O } [impl ][utils.namedSetNew](${ P } , namedValue);
644+ ${ O } [implSymbol ][utils.namedSetNew](${ P } , namedValue);
645645 } else {
646- ${ O } [impl ][utils.namedSetExisting](${ P } , namedValue);
646+ ${ O } [implSymbol ][utils.namedSetExisting](${ P } , namedValue);
647647 }
648648 ` ;
649649 } else {
650650 invocation = `
651- ${ O } [impl ].${ this . namedSetter . name } (${ P } , namedValue);
651+ ${ O } [implSymbol ].${ this . namedSetter . name } (${ P } , namedValue);
652652 ` ;
653653 }
654654
@@ -729,14 +729,14 @@ class Interface {
729729 ` ;
730730 if ( this . supportsIndexedProperties ) {
731731 this . str += `
732- for (const key of target[impl ][utils.supportedPropertyIndices]) {
732+ for (const key of target[implSymbol ][utils.supportedPropertyIndices]) {
733733 keys.add(\`\${key}\`);
734734 }
735735 ` ;
736736 }
737737 if ( this . supportsNamedProperties ) {
738738 this . str += `
739- for (const key of target[impl ][utils.supportedPropertyNames]) {
739+ for (const key of target[implSymbol ][utils.supportedPropertyNames]) {
740740 if (${ namedPropertyVisible ( "key" , "target" , true ) } ) {
741741 keys.add(\`\${key}\`);
742742 }
@@ -769,10 +769,10 @@ class Interface {
769769 let preamble = "" ;
770770 let condition ;
771771 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);` ;
773773 condition = supportsPropertyIndex ( "target" , "index" , "indexedValue" ) ;
774774 } else {
775- preamble = `const indexedValue = target[impl ]${ func } (index);` ;
775+ preamble = `const indexedValue = target[implSymbol ]${ func } (index);` ;
776776 condition = supportsPropertyIndex ( "target" , "index" ) ;
777777 }
778778
@@ -797,13 +797,13 @@ class Interface {
797797 const conditions = [ ] ;
798798 if ( utils . getExtAttr ( this . namedGetter . extAttrs , "WebIDL2JSValueAsUnsupported" ) ) {
799799 this . str += `
800- const namedValue = target[impl ]${ func } (P);
800+ const namedValue = target[implSymbol ]${ func } (P);
801801 ` ;
802802 conditions . push ( supportsPropertyName ( "target" , "index" , "namedValue" ) ) ;
803803 conditions . push ( namedPropertyVisible ( "P" , "target" , true ) ) ;
804804 } else {
805805 preamble = `
806- const namedValue = target[impl ]${ func } (P);
806+ const namedValue = target[implSymbol ]${ func } (P);
807807 ` ;
808808 conditions . push ( namedPropertyVisible ( "P" , "target" , false ) ) ;
809809 }
@@ -885,10 +885,10 @@ class Interface {
885885 let preamble = "" ;
886886 let condition ;
887887 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);` ;
889889 condition = supportsPropertyIndex ( "target" , "index" , "indexedValue" ) ;
890890 } else {
891- preamble = `const indexedValue = target[impl ]${ func } (index);` ;
891+ preamble = `const indexedValue = target[implSymbol ]${ func } (index);` ;
892892 condition = supportsPropertyIndex ( "target" , "index" ) ;
893893 }
894894
@@ -1070,11 +1070,11 @@ class Interface {
10701070
10711071 if ( this . namedDeleter . idlType . idlType === "bool" ) {
10721072 invocation = `
1073- return target[impl ]${ func } (P);
1073+ return target[implSymbol ]${ func } (P);
10741074 ` ;
10751075 } else {
10761076 invocation = `
1077- target[impl ]${ func } (P);
1077+ target[implSymbol ]${ func } (P);
10781078 return true;
10791079 ` ;
10801080 }
@@ -1111,11 +1111,11 @@ class Interface {
11111111 generateIface ( ) {
11121112 this . str += `
11131113 exports.create = function create(globalObject, constructorArgs, privateData) {
1114- if (globalObject[ctorRegistry ] === undefined) {
1114+ if (globalObject[ctorRegistrySymbol ] === undefined) {
11151115 throw new Error('Internal error: invalid global object');
11161116 }
11171117
1118- const ctor = globalObject[ctorRegistry ]["${ this . name } "];
1118+ const ctor = globalObject[ctorRegistrySymbol ]["${ this . name } "];
11191119 if (ctor === undefined) {
11201120 throw new Error('Internal error: constructor ${ this . name } is not installed on the passed global object');
11211121 }
@@ -1145,7 +1145,7 @@ class Interface {
11451145 privateData.wrapper = obj;
11461146
11471147 exports._internalSetup(obj, globalObject);
1148- Object.defineProperty(obj, impl , {
1148+ Object.defineProperty(obj, implSymbol , {
11491149 value: new Impl.implementation(globalObject, constructorArgs, privateData),
11501150 configurable: true
11511151 });
@@ -1171,9 +1171,9 @@ class Interface {
11711171 }
11721172
11731173 this . str += `
1174- obj[impl ][utils.wrapperSymbol] = obj;
1174+ obj[implSymbol ][utils.wrapperSymbol] = obj;
11751175 if (Impl.init) {
1176- Impl.init(obj[impl ], privateData);
1176+ Impl.init(obj[implSymbol ], privateData);
11771177 }
11781178 return obj;
11791179 };
@@ -1467,10 +1467,10 @@ class Interface {
14671467 this . generateOffInstanceAfterClass ( ) ;
14681468
14691469 this . str += `
1470- if (globalObject[ctorRegistry ] === undefined) {
1471- globalObject[ctorRegistry ] = Object.create(null);
1470+ if (globalObject[ctorRegistrySymbol ] === undefined) {
1471+ globalObject[ctorRegistrySymbol ] = Object.create(null);
14721472 }
1473- globalObject[ctorRegistry ][interfaceName] = ${ name } ;
1473+ globalObject[ctorRegistrySymbol ][interfaceName] = ${ name } ;
14741474
14751475 Object.defineProperty(globalObject, interfaceName, {
14761476 configurable: true,
0 commit comments