mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
These tests were designed to test the built-in "Promise.race Resolve Element function," but ECMA262 does not describe such a function. Contrary to the test's description, the function under test is created by the InstantiateArrowFunctionExpression abstract operation. The following tests verify most of the details directly (only the function object's extensibility was not already tested by the existing tests): - test/language/expressions/arrow-function/name.js - test/language/expressions/arrow-function/throw-new.js - test/language/expressions/arrow-function/prototype-rules.js The definition of the built-in resolving functions is closely related, but Test262 already includes tests for the corresponding concerns: - test/built-ins/Promise/resolve-function-extensible.js - test/built-ins/Promise/resolve-function-name.js - test/built-ins/Promise/resolve-function-nonconstructor.js - test/built-ins/Promise/resolve-function-prototype.js Remove the tests and introduce one additional test to preserve coverage while improving discoverability.
30 lines
1.2 KiB
JavaScript
30 lines
1.2 KiB
JavaScript
// Copyright (C) 2021 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
|
description: The [[Extensible]] slot of arrow functions
|
|
info: |
|
|
15.3.4 Runtime Semantics: InstantiateArrowFunctionExpression
|
|
[...]
|
|
4. Let closure be OrdinaryFunctionCreate(%Function.prototype%, sourceText,
|
|
ArrowParameters, ConciseBody, lexical-this, scope).
|
|
|
|
10.2.3 OrdinaryFunctionCreate ( functionPrototype, sourceText, ParameterList, Body, thisMode, Scope )
|
|
[...]
|
|
3. Let F be ! OrdinaryObjectCreate(functionPrototype, internalSlotsList).
|
|
|
|
10.1.12 OrdinaryObjectCreate ( proto [ , additionalInternalSlotsList ] )
|
|
1. Let internalSlotsList be « [[Prototype]], [[Extensible]] ».
|
|
2. If additionalInternalSlotsList is present, append each of its elements
|
|
to internalSlotsList.
|
|
3. Let O be ! MakeBasicObject(internalSlotsList).
|
|
|
|
7.3.1 MakeBasicObject ( internalSlotsList )
|
|
[...]
|
|
6. If internalSlotsList contains [[Extensible]], set obj.[[Extensible]] to
|
|
true.
|
|
---*/
|
|
|
|
assert(Object.isExtensible(() => {}));
|