summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/arrow-function/extensibility.js
blob: e645da217939962950faeb508663da9bd3d0cc7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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(() => {}));

reportCompare(0, 0);