mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Update web-platform-tests to revision 3efff9b2d66aed3d8e2061205069883fd54df2be
This commit is contained in:
parent
9832feddf3
commit
f80ff24202
51 changed files with 1026 additions and 868 deletions
|
@ -49,6 +49,22 @@ for (const type of ["i32", "f32", "f64"]) {
|
|||
assert_equals(global.value, 0, "post-set value");
|
||||
assert_equals(global.valueOf(), 0, "post-set valueOf");
|
||||
}, `Immutable ${type} (${name})`);
|
||||
|
||||
test(t => {
|
||||
opts.value = type;
|
||||
const global = new WebAssembly.Global(opts);
|
||||
assert_equals(global.value, 0, "initial value");
|
||||
assert_equals(global.valueOf(), 0, "initial valueOf");
|
||||
|
||||
const value = {
|
||||
valueOf: t.unreached_func("should not call valueOf"),
|
||||
toString: t.unreached_func("should not call toString"),
|
||||
};
|
||||
assert_throws(new TypeError(), () => global.value = value);
|
||||
|
||||
assert_equals(global.value, 0, "post-set value");
|
||||
assert_equals(global.valueOf(), 0, "post-set valueOf");
|
||||
}, `Immutable ${type} with ToNumber side-effects (${name})`);
|
||||
}
|
||||
|
||||
const mutableOptions = [
|
||||
|
@ -80,6 +96,15 @@ test(() => {
|
|||
assert_throws(new TypeError(), () => global.valueOf());
|
||||
}, "i64 with default");
|
||||
|
||||
test(t => {
|
||||
const argument = { "value": "i64", "mutable": true };
|
||||
const global = new WebAssembly.Global(argument);
|
||||
const value = {
|
||||
valueOf: t.unreached_func("should not call valueOf"),
|
||||
toString: t.unreached_func("should not call toString"),
|
||||
};
|
||||
assert_throws(new TypeError(), () => global.value = value);
|
||||
}, "i64 with ToNumber side-effects");
|
||||
|
||||
test(() => {
|
||||
const argument = { "value": "i32", "mutable": true };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue