File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,18 @@ ${this.name}PropertiesConstructor.prototype.constructor = ${this.name}Properties
42
42
43
43
this . str += `
44
44
const ${ this . name } Properties = new Proxy(${ this . name } PropertiesConstructor.prototype, {
45
+ defineProperty() {
46
+ return false;
47
+ },
48
+ deleteProperty() {
49
+ return false;
50
+ },
45
51
get(target, key) {
46
52
if (key in this) {
47
53
return this[key];
48
54
}
49
55
return target[key];
50
56
},
51
- set(target, key, value) {
52
- this[key] = value;
53
- return true;
54
- }
55
57
});\n\n` ;
56
58
} ;
57
59
@@ -97,8 +99,7 @@ Interface.prototype.generateConstructor = function () {
97
99
this . str += `${ this . name } .prototype = Object.create(${ this . idl . inheritance } .interface.prototype);
98
100
${ this . name } .prototype.constructor = ${ this . name } ;\n`;
99
101
} else if ( utils . isGlobal ( this . idl ) ) {
100
- this . str += `${ this . name } .prototype = Object.create(${ this . name } Properties);
101
- ${ this . name } .prototype.constructor = ${ this . name } ;\n`;
102
+ this . str += `Object.setPrototypeOf(${ this . name } .prototype, ${ this . name } Properties);\n` ;
102
103
}
103
104
} ;
104
105
You can’t perform that action at this time.
0 commit comments