Skip to content

Commit

Permalink
WebIDL: Add tests for function property enumeration order
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Oct 8, 2021
1 parent 3ee661f commit 234a7d4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions webidl/ecmascript-binding/builtin-function-properties.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"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"');

0 comments on commit 234a7d4

Please sign in to comment.