fune/testing/web-platform/tests/webidl/ecmascript-binding/builtin-function-properties.any.js
ExE Boss d27ae18fdc Bug 1729006 [wpt PR 30333] - [WebIDL] Add tests for function property enumeration order, a=testonly
Automatic update from web-platform-tests
WebIDL: Add tests for function property enumeration order

--

wpt-commits: 0642e19a4ebf4e74f09b22934fdcc29640dc3a2a
wpt-pr: 30333
2022-12-11 12:06:38 +00:00

23 lines
856 B
JavaScript

"use strict";
test(() => {
const ownPropKeys = Reflect.ownKeys(Blob).slice(0, 3);
assert_array_equals(ownPropKeys, ["length", "name", "prototype"]);
}, 'Constructor property enumeration order of "length", "name", and "prototype"');
test(() => {
assert_own_property(Blob.prototype, "slice");
const ownPropKeys = Reflect.ownKeys(Blob.prototype.slice).slice(0, 2);
assert_array_equals(ownPropKeys, ["length", "name"]);
}, 'Method property enumeration order of "length" and "name"');
test(() => {
assert_own_property(Blob.prototype, "size");
const desc = Reflect.getOwnPropertyDescriptor(Blob.prototype, "size");
assert_equals(typeof desc.get, "function");
const ownPropKeys = Reflect.ownKeys(desc.get).slice(0, 2);
assert_array_equals(ownPropKeys, ["length", "name"]);
}, 'Getter property enumeration order of "length" and "name"');