Skip to content

Commit 0642e19

Browse files
ExE-BossMs2ger
authored andcommitted
WebIDL: Add tests for function property enumeration order
1 parent df2f4f4 commit 0642e19

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"use strict";
2+
3+
test(() => {
4+
const ownPropKeys = Reflect.ownKeys(Blob).slice(0, 3);
5+
assert_array_equals(ownPropKeys, ["length", "name", "prototype"]);
6+
}, 'Constructor property enumeration order of "length", "name", and "prototype"');
7+
8+
test(() => {
9+
assert_own_property(Blob.prototype, "slice");
10+
11+
const ownPropKeys = Reflect.ownKeys(Blob.prototype.slice).slice(0, 2);
12+
assert_array_equals(ownPropKeys, ["length", "name"]);
13+
}, 'Method property enumeration order of "length" and "name"');
14+
15+
test(() => {
16+
assert_own_property(Blob.prototype, "size");
17+
18+
const desc = Reflect.getOwnPropertyDescriptor(Blob.prototype, "size");
19+
assert_equals(typeof desc.get, "function");
20+
21+
const ownPropKeys = Reflect.ownKeys(desc.get).slice(0, 2);
22+
assert_array_equals(ownPropKeys, ["length", "name"]);
23+
}, 'Getter property enumeration order of "length" and "name"');

0 commit comments

Comments
 (0)