From eeae471b0a68614e7a378157728946e64717785c Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Wed, 24 Apr 2024 16:58:03 +0000 Subject: [PATCH] Use correct order when defining length/name/prototype on legacy factory functions. Implements https://github.com/whatwg/webidl/pull/914 for legacy factory functions. https://bugzilla.mozilla.org/show_bug.cgi?id=1629803 is the bug that would fix this in SpiderMonkey, working around that for now. Differential Revision: https://phabricator.services.mozilla.com/D205805 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1887721 gecko-commit: 0594801ef8e281f5be66076d27a72c5c8c9496e9 gecko-reviewers: saschanaz --- .../legacy-factory-function-builtin-properties.window.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 webidl/ecmascript-binding/legacy-factory-function-builtin-properties.window.js diff --git a/webidl/ecmascript-binding/legacy-factory-function-builtin-properties.window.js b/webidl/ecmascript-binding/legacy-factory-function-builtin-properties.window.js new file mode 100644 index 00000000000000..fc5c48aca380c0 --- /dev/null +++ b/webidl/ecmascript-binding/legacy-factory-function-builtin-properties.window.js @@ -0,0 +1,6 @@ +"use strict"; + +test(() => { + const ownPropKeys = Reflect.ownKeys(Image).slice(0, 3); + assert_array_equals(ownPropKeys, ["length", "name", "prototype"]); +}, 'Legacy factory function property enumeration order of "length", "name", and "prototype"');