Skip to content

Commit

Permalink
Fix static attribute setters
Browse files Browse the repository at this point in the history
Fixes #199.
  • Loading branch information
ExE-Boss authored Apr 29, 2020
1 parent 2732dd2 commit 7d45dfc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/constructs/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ class Interface {
addOne(`static get ${propName}`, [], body[0]);
}
if (body[1] !== undefined) {
addOne(`static set ${propName}`, args, body[0]);
addOne(`static set ${propName}`, args, body[1]);
}
}
}
Expand Down
20 changes: 16 additions & 4 deletions test/__snapshots__/test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,11 @@ exports.install = (globalObject, globalNames) => {
static set staticAttr(V) {
const esValue = this !== null && this !== undefined ? this : globalObject;

return Impl.implementation[\\"staticAttr\\"];
V = conversions[\\"DOMString\\"](V, {
context: \\"Failed to set the 'staticAttr' property on 'Global': The provided value\\"
});

Impl.implementation[\\"staticAttr\\"] = V;
}
}
Object.defineProperties(Global.prototype, { [Symbol.toStringTag]: { value: \\"Global\\", configurable: true } });
Expand Down Expand Up @@ -4727,7 +4731,9 @@ exports.install = (globalObject, globalNames) => {
static set abc(V) {
const esValue = this !== null && this !== undefined ? this : globalObject;

return Impl.implementation[\\"abc\\"];
V = conversions[\\"DOMString\\"](V, { context: \\"Failed to set the 'abc' property on 'Static': The provided value\\" });

Impl.implementation[\\"abc\\"] = V;
}
}
Object.defineProperties(Static.prototype, {
Expand Down Expand Up @@ -10821,7 +10827,11 @@ exports.install = (globalObject, globalNames) => {
static set staticAttr(V) {
const esValue = this !== null && this !== undefined ? this : globalObject;

return Impl.implementation[\\"staticAttr\\"];
V = conversions[\\"DOMString\\"](V, {
context: \\"Failed to set the 'staticAttr' property on 'Global': The provided value\\"
});

Impl.implementation[\\"staticAttr\\"] = V;
}
}
Object.defineProperties(Global.prototype, { [Symbol.toStringTag]: { value: \\"Global\\", configurable: true } });
Expand Down Expand Up @@ -13522,7 +13532,9 @@ exports.install = (globalObject, globalNames) => {
static set abc(V) {
const esValue = this !== null && this !== undefined ? this : globalObject;

return Impl.implementation[\\"abc\\"];
V = conversions[\\"DOMString\\"](V, { context: \\"Failed to set the 'abc' property on 'Static': The provided value\\" });

Impl.implementation[\\"abc\\"] = V;
}
}
Object.defineProperties(Static.prototype, {
Expand Down

0 comments on commit 7d45dfc

Please sign in to comment.