@@ -404,7 +404,7 @@ class Interface {
404404 value: function next() {
405405 const internal = this[utils.iterInternalSymbol];
406406 const { target, kind, index } = internal;
407- const values = Array.from(target[implSymbol ]);
407+ const values = Array.from(target[impl ]);
408408 const len = values.length;
409409 if (index >= len) {
410410 return { value: undefined, done: true };
@@ -498,9 +498,9 @@ class Interface {
498498 }
499499
500500 generateRequires ( ) {
501- this . requires . addRaw ( "implSymbol" , "utils.implSymbol" ) ;
501+ this . requires . addRaw ( "impl" , "utils.implSymbol" ) ;
502+ this . requires . addRaw ( "ctorRegistry" , "utils.ctorRegistrySymbol" ) ;
502503 this . requires . addRaw ( "wrapperSymbol" , "utils.wrapperSymbol" ) ;
503- this . requires . addRaw ( "ctorRegistrySymbol" , "utils.ctorRegistrySymbol" ) ;
504504 this . requires . addRaw ( "globalObjectSymbol" , "utils.globalObjectSymbol" ) ;
505505 this . requires . addRaw ( "createWrapperSymbol" , "utils.createWrapperSymbol" ) ;
506506
@@ -537,7 +537,7 @@ class Interface {
537537 exports._mixedIntoPredicates = [];
538538 exports.is = function is(obj) {
539539 if (obj) {
540- if (utils.hasOwn(obj, implSymbol ) && obj[implSymbol ] instanceof Impl.implementation) {
540+ if (utils.hasOwn(obj, impl ) && obj[impl ] instanceof Impl.implementation) {
541541 return true;
542542 }
543543 for (const isMixedInto of exports._mixedIntoPredicates) {
@@ -598,10 +598,10 @@ class Interface {
598598 }
599599 if ( unsupportedValue ) {
600600 const func = this . indexedGetter . name ? `.${ this . indexedGetter . name } ` : "[utils.indexedGet]" ;
601- const value = indexedValue || `${ O } [implSymbol ]${ func } (${ index } )` ;
601+ const value = indexedValue || `${ O } [impl ]${ func } (${ index } )` ;
602602 return `${ value } !== ${ unsupportedValue } ` ;
603603 }
604- return `${ O } [implSymbol ][utils.supportsPropertyIndex](${ index } )` ;
604+ return `${ O } [impl ][utils.supportsPropertyIndex](${ index } )` ;
605605 } ;
606606
607607 const supportsPropertyName = ( O , P , namedValue ) => {
@@ -611,10 +611,10 @@ class Interface {
611611 }
612612 if ( unsupportedValue ) {
613613 const func = this . namedGetter . name ? `.${ this . namedGetter . name } ` : "[utils.namedGet]" ;
614- const value = namedValue || `${ O } [implSymbol ]${ func } (${ P } )` ;
614+ const value = namedValue || `${ O } [impl ]${ func } (${ P } )` ;
615615 return `${ value } !== ${ unsupportedValue } ` ;
616616 }
617- return `${ O } [implSymbol ][utils.supportsPropertyName](${ P } )` ;
617+ return `${ O } [impl ][utils.supportsPropertyName](${ P } )` ;
618618 } ;
619619
620620 // "named property visibility algorithm"
@@ -651,14 +651,14 @@ class Interface {
651651 str += `
652652 const creating = !(${ supportsPropertyIndex ( O , "index" ) } );
653653 if (creating) {
654- ${ O } [implSymbol ][utils.indexedSetNew](index, indexedValue);
654+ ${ O } [impl ][utils.indexedSetNew](index, indexedValue);
655655 } else {
656- ${ O } [implSymbol ][utils.indexedSetExisting](index, indexedValue);
656+ ${ O } [impl ][utils.indexedSetExisting](index, indexedValue);
657657 }
658658 ` ;
659659 } else {
660660 str += `
661- ${ O } [implSymbol ].${ this . indexedSetter . name } (index, indexedValue);
661+ ${ O } [impl ].${ this . indexedSetter . name } (index, indexedValue);
662662 ` ;
663663 }
664664
@@ -682,14 +682,14 @@ class Interface {
682682 str += `
683683 const creating = !(${ supportsPropertyName ( O , P ) } );
684684 if (creating) {
685- ${ O } [implSymbol ][utils.namedSetNew](${ P } , namedValue);
685+ ${ O } [impl ][utils.namedSetNew](${ P } , namedValue);
686686 } else {
687- ${ O } [implSymbol ][utils.namedSetExisting](${ P } , namedValue);
687+ ${ O } [impl ][utils.namedSetExisting](${ P } , namedValue);
688688 }
689689 ` ;
690690 } else {
691691 str += `
692- ${ O } [implSymbol ].${ this . namedSetter . name } (${ P } , namedValue);
692+ ${ O } [impl ].${ this . namedSetter . name } (${ P } , namedValue);
693693 ` ;
694694 }
695695
@@ -752,14 +752,14 @@ class Interface {
752752 ` ;
753753 if ( this . supportsIndexedProperties ) {
754754 this . str += `
755- for (const key of target[implSymbol ][utils.supportedPropertyIndices]) {
755+ for (const key of target[impl ][utils.supportedPropertyIndices]) {
756756 keys.add(\`\${key}\`);
757757 }
758758 ` ;
759759 }
760760 if ( this . supportsNamedProperties ) {
761761 this . str += `
762- for (const key of target[implSymbol ][utils.supportedPropertyNames]) {
762+ for (const key of target[impl ][utils.supportedPropertyNames]) {
763763 if (${ namedPropertyVisible ( "key" , "target" , true ) } ) {
764764 keys.add(\`\${key}\`);
765765 }
@@ -792,10 +792,10 @@ class Interface {
792792 let preamble = "" ;
793793 let condition ;
794794 if ( utils . getExtAttr ( this . indexedGetter . extAttrs , "WebIDL2JSValueAsUnsupported" ) ) {
795- this . str += `const indexedValue = target[implSymbol ]${ func } (index);` ;
795+ this . str += `const indexedValue = target[impl ]${ func } (index);` ;
796796 condition = supportsPropertyIndex ( "target" , "index" , "indexedValue" ) ;
797797 } else {
798- preamble = `const indexedValue = target[implSymbol ]${ func } (index);` ;
798+ preamble = `const indexedValue = target[impl ]${ func } (index);` ;
799799 condition = supportsPropertyIndex ( "target" , "index" ) ;
800800 }
801801
@@ -820,13 +820,13 @@ class Interface {
820820 const conditions = [ ] ;
821821 if ( utils . getExtAttr ( this . namedGetter . extAttrs , "WebIDL2JSValueAsUnsupported" ) ) {
822822 this . str += `
823- const namedValue = target[implSymbol ]${ func } (P);
823+ const namedValue = target[impl ]${ func } (P);
824824 ` ;
825825 conditions . push ( supportsPropertyName ( "target" , "index" , "namedValue" ) ) ;
826826 conditions . push ( namedPropertyVisible ( "P" , "target" , true ) ) ;
827827 } else {
828828 preamble = `
829- const namedValue = target[implSymbol ]${ func } (P);
829+ const namedValue = target[impl ]${ func } (P);
830830 ` ;
831831 conditions . push ( namedPropertyVisible ( "P" , "target" , false ) ) ;
832832 }
@@ -902,10 +902,10 @@ class Interface {
902902 let preamble = "" ;
903903 let condition ;
904904 if ( utils . getExtAttr ( this . indexedGetter . extAttrs , "WebIDL2JSValueAsUnsupported" ) ) {
905- this . str += `const indexedValue = target[implSymbol ]${ func } (index);` ;
905+ this . str += `const indexedValue = target[impl ]${ func } (index);` ;
906906 condition = supportsPropertyIndex ( "target" , "index" , "indexedValue" ) ;
907907 } else {
908- preamble = `const indexedValue = target[implSymbol ]${ func } (index);` ;
908+ preamble = `const indexedValue = target[impl ]${ func } (index);` ;
909909 condition = supportsPropertyIndex ( "target" , "index" ) ;
910910 }
911911
@@ -1071,11 +1071,11 @@ class Interface {
10711071 const func = this . namedDeleter . name ? `.${ this . namedDeleter . name } ` : "[utils.namedDelete]" ;
10721072 if ( this . namedDeleter . idlType . idlType === "bool" ) {
10731073 this . str += `
1074- return target[implSymbol ]${ func } (P);
1074+ return target[impl ]${ func } (P);
10751075 ` ;
10761076 } else {
10771077 this . str += `
1078- target[implSymbol ]${ func } (P);
1078+ target[impl ]${ func } (P);
10791079 return true;
10801080 ` ;
10811081 }
@@ -1103,51 +1103,55 @@ class Interface {
11031103
11041104 generateIface ( ) {
11051105 this . str += `
1106- function createWrapper(impl ) {
1107- const globalObject = impl [globalObjectSymbol];
1106+ function createWrapper(implObject ) {
1107+ const globalObject = implObject [globalObjectSymbol];
11081108
1109- if (globalObject[ctorRegistrySymbol ] === undefined) {
1109+ if (globalObject[ctorRegistry ] === undefined) {
11101110 throw new Error('Internal error: invalid global object');
11111111 }
11121112
1113- const ctor = globalObject[ctorRegistrySymbol ]["${ this . name } "];
1113+ const ctor = globalObject[ctorRegistry ]["${ this . name } "];
11141114 if (ctor === undefined) {
11151115 throw new Error('Internal error: constructor ${ this . name } is not installed on the passed global object');
11161116 }
11171117
1118- let wrapper = Object.create(ctor.prototype);
1119- exports._internalSetup(wrapper );
1118+ let wrapperObject = Object.create(ctor.prototype);
1119+ exports._internalSetup(wrapperObject );
11201120 ` ;
11211121
11221122 if ( this . isLegacyPlatformObj ) {
11231123 this . str += `
1124- wrapper = new Proxy(wrapper , proxyHandler);
1124+ wrapperObject = new Proxy(wrapperObject , proxyHandler);
11251125 ` ;
11261126 }
11271127
11281128 this . str += `
1129- impl [wrapperSymbol] = wrapper ;
1130- wrapper[implSymbol ] = impl ;
1131- return wrapper ;
1129+ implObject [wrapperSymbol] = wrapperObject ;
1130+ wrapperObject[impl ] = implObject ;
1131+ return wrapperObject ;
11321132 };
11331133 exports.create = function create(globalObject, constructorArgs, privateData) {
1134- const impl = exports.createImpl(globalObject, constructorArgs, privateData);
1135- return utils.wrapperForImpl(impl );
1134+ const implObject = exports.createImpl(globalObject, constructorArgs, privateData);
1135+ return utils.wrapperForImpl(implObject );
11361136 };
11371137 exports.createImpl = function createImpl(globalObject, constructorArgs = [], privateData = {}) {
1138- const impl = new Impl.implementation(globalObject, constructorArgs, privateData);
1138+ const implObject = new Impl.implementation(globalObject, constructorArgs, privateData);
11391139
1140- impl [wrapperSymbol] = null;
1141- impl [globalObjectSymbol] = globalObject;
1142- impl [createWrapperSymbol] = createWrapper;
1140+ implObject [wrapperSymbol] = null;
1141+ implObject [globalObjectSymbol] = globalObject;
1142+ implObject [createWrapperSymbol] = createWrapper;
11431143
1144- return impl ;
1144+ return implObject ;
11451145 };
1146- exports.setup = function setup(wrapper, globalObject, constructorArgs = [], privateData = {}) {
1147- const impl = exports.createImpl(globalObject, constructorArgs, privateData);
1148- impl[wrapperSymbol] = wrapper;
1149- wrapper[implSymbol] = impl;
1150- return wrapper;
1146+ exports.setup = function setup(wrapperObject, globalObject, constructorArgs = [], privateData = {}) {
1147+ const implObject = exports.createImpl(globalObject, constructorArgs, privateData);
1148+
1149+ implObject[wrapperSymbol] = wrapperObject;
1150+ wrapperObject[impl] = implObject;
1151+
1152+ exports._internalSetup(wrapperObject);
1153+
1154+ return wrapperObject;
11511155 };
11521156 exports._internalSetup = function _internalSetup(obj) {
11531157 ` ;
@@ -1445,10 +1449,10 @@ class Interface {
14451449 this . generateOffInstanceAfterClass ( ) ;
14461450
14471451 this . str += `
1448- if (globalObject[ctorRegistrySymbol ] === undefined) {
1449- globalObject[ctorRegistrySymbol ] = Object.create(null);
1452+ if (globalObject[ctorRegistry ] === undefined) {
1453+ globalObject[ctorRegistry ] = Object.create(null);
14501454 }
1451- globalObject[ctorRegistrySymbol ]["${ name } "] = ${ name } ;
1455+ globalObject[ctorRegistry ]["${ name } "] = ${ name } ;
14521456
14531457 Object.defineProperty(globalObject, "${ name } ", {
14541458 configurable: true,
0 commit comments