Skip to content

Commit 5c8b62b

Browse files
committed
Add generated sources for release.
1 parent 772cddf commit 5c8b62b

187 files changed

Lines changed: 47889 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ test/web-platform-tests/tuwpt-manifest.json
1010
npm-debug.log*
1111
benchmark/browser-bundle.js
1212

13-
lib/jsdom/living/generated/**/*.js
13+
#lib/jsdom/living/generated/**/*.js
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
"use strict";
2+
3+
const conversions = require("webidl-conversions");
4+
const utils = require("./utils.js");
5+
6+
const impl = utils.implSymbol;
7+
8+
module.exports = {
9+
createInterface: function(defaultPrivateData = {}) {
10+
function AbortController() {
11+
if (new.target === undefined) {
12+
throw new TypeError(
13+
"Failed to construct 'AbortController'. Please use the 'new' operator; this constructor " +
14+
"cannot be called as a function."
15+
);
16+
}
17+
18+
iface.setup(this);
19+
}
20+
21+
Object.defineProperty(AbortController, "prototype", {
22+
value: AbortController.prototype,
23+
writable: false,
24+
enumerable: false,
25+
configurable: false
26+
});
27+
28+
AbortController.prototype.abort = function abort() {
29+
if (!this || !module.exports.is(this)) {
30+
throw new TypeError("Illegal invocation");
31+
}
32+
33+
return this[impl].abort();
34+
};
35+
36+
Object.defineProperty(AbortController.prototype, "signal", {
37+
get() {
38+
if (!this || !module.exports.is(this)) {
39+
throw new TypeError("Illegal invocation");
40+
}
41+
42+
return utils.getSameObject(this, "signal", () => {
43+
return utils.tryWrapperForImpl(this[impl]["signal"]);
44+
});
45+
},
46+
47+
enumerable: true,
48+
configurable: true
49+
});
50+
51+
Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {
52+
value: "AbortController",
53+
writable: false,
54+
enumerable: false,
55+
configurable: true
56+
});
57+
58+
const iface = {
59+
create(constructorArgs, privateData) {
60+
let obj = Object.create(AbortController.prototype);
61+
obj = this.setup(obj, constructorArgs, privateData);
62+
return obj;
63+
},
64+
createImpl(constructorArgs, privateData) {
65+
let obj = Object.create(AbortController.prototype);
66+
obj = this.setup(obj, constructorArgs, privateData);
67+
return utils.implForWrapper(obj);
68+
},
69+
_internalSetup(obj) {},
70+
setup(obj, constructorArgs, privateData) {
71+
if (!privateData) privateData = {};
72+
73+
for (var prop in defaultPrivateData) {
74+
if (!(prop in privateData)) {
75+
privateData[prop] = defaultPrivateData[prop];
76+
}
77+
}
78+
79+
privateData.wrapper = obj;
80+
81+
this._internalSetup(obj);
82+
Object.defineProperty(obj, impl, {
83+
value: new Impl.implementation(constructorArgs, privateData),
84+
writable: false,
85+
enumerable: false,
86+
configurable: true
87+
});
88+
89+
obj[impl][utils.wrapperSymbol] = obj;
90+
if (Impl.init) {
91+
Impl.init(obj[impl], privateData);
92+
}
93+
return obj;
94+
},
95+
interface: AbortController,
96+
expose: {
97+
Window: { AbortController },
98+
Worker: { AbortController }
99+
}
100+
}; // iface
101+
return iface;
102+
}, // createInterface
103+
104+
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
105+
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
106+
// implementing this mixin interface.
107+
_mixedIntoPredicates: [],
108+
is(obj) {
109+
if (obj) {
110+
if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) {
111+
return true;
112+
}
113+
for (const isMixedInto of module.exports._mixedIntoPredicates) {
114+
if (isMixedInto(obj)) {
115+
return true;
116+
}
117+
}
118+
}
119+
return false;
120+
},
121+
isImpl(obj) {
122+
if (obj) {
123+
if (obj instanceof Impl.implementation) {
124+
return true;
125+
}
126+
127+
const wrapper = utils.wrapperForImpl(obj);
128+
for (const isMixedInto of module.exports._mixedIntoPredicates) {
129+
if (isMixedInto(wrapper)) {
130+
return true;
131+
}
132+
}
133+
}
134+
return false;
135+
},
136+
convert(obj, { context = "The provided value" } = {}) {
137+
if (module.exports.is(obj)) {
138+
return utils.implForWrapper(obj);
139+
}
140+
throw new TypeError(`${context} is not of type 'AbortController'.`);
141+
}
142+
}; // module.exports
143+
144+
const Impl = require("../aborting/AbortController-impl.js");
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
"use strict";
2+
3+
const conversions = require("webidl-conversions");
4+
const utils = require("./utils.js");
5+
6+
const impl = utils.implSymbol;
7+
const EventTarget = require("./EventTarget.js");
8+
9+
module.exports = {
10+
createInterface: function(defaultPrivateData = {}) {
11+
function AbortSignal() {
12+
throw new TypeError("Illegal constructor");
13+
}
14+
15+
Object.setPrototypeOf(AbortSignal.prototype, EventTarget.interface.prototype);
16+
Object.setPrototypeOf(AbortSignal, EventTarget.interface);
17+
18+
Object.defineProperty(AbortSignal, "prototype", {
19+
value: AbortSignal.prototype,
20+
writable: false,
21+
enumerable: false,
22+
configurable: false
23+
});
24+
25+
Object.defineProperty(AbortSignal.prototype, "aborted", {
26+
get() {
27+
if (!this || !module.exports.is(this)) {
28+
throw new TypeError("Illegal invocation");
29+
}
30+
31+
return this[impl]["aborted"];
32+
},
33+
34+
enumerable: true,
35+
configurable: true
36+
});
37+
38+
Object.defineProperty(AbortSignal.prototype, "onabort", {
39+
get() {
40+
if (!this || !module.exports.is(this)) {
41+
throw new TypeError("Illegal invocation");
42+
}
43+
44+
return utils.tryWrapperForImpl(this[impl]["onabort"]);
45+
},
46+
47+
set(V) {
48+
if (!this || !module.exports.is(this)) {
49+
throw new TypeError("Illegal invocation");
50+
}
51+
52+
V = utils.tryImplForWrapper(V);
53+
54+
this[impl]["onabort"] = V;
55+
},
56+
57+
enumerable: true,
58+
configurable: true
59+
});
60+
61+
Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {
62+
value: "AbortSignal",
63+
writable: false,
64+
enumerable: false,
65+
configurable: true
66+
});
67+
68+
const iface = {
69+
create(constructorArgs, privateData) {
70+
let obj = Object.create(AbortSignal.prototype);
71+
obj = this.setup(obj, constructorArgs, privateData);
72+
return obj;
73+
},
74+
createImpl(constructorArgs, privateData) {
75+
let obj = Object.create(AbortSignal.prototype);
76+
obj = this.setup(obj, constructorArgs, privateData);
77+
return utils.implForWrapper(obj);
78+
},
79+
_internalSetup(obj) {
80+
EventTarget._internalSetup(obj);
81+
},
82+
setup(obj, constructorArgs, privateData) {
83+
if (!privateData) privateData = {};
84+
85+
for (var prop in defaultPrivateData) {
86+
if (!(prop in privateData)) {
87+
privateData[prop] = defaultPrivateData[prop];
88+
}
89+
}
90+
91+
privateData.wrapper = obj;
92+
93+
this._internalSetup(obj);
94+
Object.defineProperty(obj, impl, {
95+
value: new Impl.implementation(constructorArgs, privateData),
96+
writable: false,
97+
enumerable: false,
98+
configurable: true
99+
});
100+
101+
obj[impl][utils.wrapperSymbol] = obj;
102+
if (Impl.init) {
103+
Impl.init(obj[impl], privateData);
104+
}
105+
return obj;
106+
},
107+
interface: AbortSignal,
108+
expose: {
109+
Window: { AbortSignal },
110+
Worker: { AbortSignal }
111+
}
112+
}; // iface
113+
return iface;
114+
}, // createInterface
115+
116+
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
117+
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
118+
// implementing this mixin interface.
119+
_mixedIntoPredicates: [],
120+
is(obj) {
121+
if (obj) {
122+
if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) {
123+
return true;
124+
}
125+
for (const isMixedInto of module.exports._mixedIntoPredicates) {
126+
if (isMixedInto(obj)) {
127+
return true;
128+
}
129+
}
130+
}
131+
return false;
132+
},
133+
isImpl(obj) {
134+
if (obj) {
135+
if (obj instanceof Impl.implementation) {
136+
return true;
137+
}
138+
139+
const wrapper = utils.wrapperForImpl(obj);
140+
for (const isMixedInto of module.exports._mixedIntoPredicates) {
141+
if (isMixedInto(wrapper)) {
142+
return true;
143+
}
144+
}
145+
}
146+
return false;
147+
},
148+
convert(obj, { context = "The provided value" } = {}) {
149+
if (module.exports.is(obj)) {
150+
return utils.implForWrapper(obj);
151+
}
152+
throw new TypeError(`${context} is not of type 'AbortSignal'.`);
153+
}
154+
}; // module.exports
155+
156+
const Impl = require("../aborting/AbortSignal-impl.js");
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"use strict";
2+
3+
const conversions = require("webidl-conversions");
4+
const utils = require("./utils.js");
5+
6+
const EventListenerOptions = require("./EventListenerOptions.js");
7+
8+
module.exports = {
9+
convertInherit(obj, ret, { context = "The provided value" } = {}) {
10+
EventListenerOptions.convertInherit(obj, ret, { context });
11+
12+
{
13+
const key = "once";
14+
let value = obj === undefined || obj === null ? undefined : obj[key];
15+
if (value !== undefined) {
16+
value = conversions["boolean"](value, { context: context + " has member once that" });
17+
18+
ret[key] = value;
19+
} else {
20+
ret[key] = false;
21+
}
22+
}
23+
},
24+
25+
convert(obj, { context = "The provided value" } = {}) {
26+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
27+
throw new TypeError(`${context} is not an object.`);
28+
}
29+
30+
const ret = Object.create(null);
31+
module.exports.convertInherit(obj, ret, { context });
32+
return ret;
33+
}
34+
};

0 commit comments

Comments
 (0)