-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebIDL: Add tests for function property enumeration order
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
webidl/ecmascript-binding/builtin-function-properties.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"'); |