Skip to content

Instantly share code, notes, and snippets.

@arv
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arv/f820c7c02a8119eb27a3 to your computer and use it in GitHub Desktop.
Save arv/f820c7c02a8119eb27a3 to your computer and use it in GitHub Desktop.
Unscopables spec update

13.10.4 Runtime Semantics: Evaluation

WithStatement : with ( Expression ) Statement

  1. Let val be the result of evaluating Expression.
  2. Let obj be ToObject(GetValue(val)).
  3. ReturnIfAbrupt(obj).
  4. Let oldEnv be the running execution context’s LexicalEnvironment.
  5. Let newEnv be NewObjectEnvironment(obj, oldEnv).
  6. Set the withEnvironment flag of newEnv’s environment record to true.
  7. Set the running execution context’s LexicalEnvironment to newEnv.
  8. Let C be the result of evaluating Statement.
  9. Set the running execution context’s Lexical Environment to oldEnv.
  10. Return C.

22.1.3.31 Array.prototype [ @@unscopables ]

The initial value of the @@unscopables data property is an object created by the following steps:

  1. Let blackList be ObjectCreate(%ObjectPrototype%).
  2. Call CreateDataProperty(blackList, "find", true) .
  3. Call CreateDataProperty(blackList, "findIndex", true).
  4. Call CreateDataProperty(blackList, "fill", true).
  5. Call CreateDataProperty(blackList, "copyWithin", true).
  6. Call CreateDataProperty(blackList, "entries", true).
  7. Call CreateDataProperty(blackList, "keys", true).
  8. Call CreateDataProperty(blackList, "values", true).
  9. Assert: Each of the above calls will return true.
  10. Return blackList.

8.1.1.2.1 HasBinding(N)

The concrete Environment Record method HasBinding for object environment records determines if its associated binding object has a property whose name is the value of the argument N:

  1. Let envRec be the object environment record for which the method was invoked.
  2. Let binding be the binding object for envRec.
  3. Let has be HasProperty(binding, N).
  4. ReturnIfAbrupt(has).
  5. If has is false, return false.
  6. Let unscobables be Get(binding, @@unscopables).
  7. ReturnIfAbrupt(unscobables).
  8. If Type(unscopables) is not Object, then return true.
  9. Let isBlocked be HasProperty(unscopables, N).
  10. ReturnIfAbrupt(isBlocked).
  11. If isBlocked is true, return false.
  12. Return true.

8.1.1.2.6 GetBindingValue(N, S)

  1. Let envRec be the object environment record for which the method was invoked.
  2. Let bindings be the binding object for envRec.
  3. Let has be HasProperty(bindings, N).
  4. ReturnIfAbrupt(has).
  5. If has is true, then
    1. Let unscobables be Get(binding, @@unscopables).
    2. ReturnIfAbrupt(unscobables).
    3. Let isBlocked be false.
    4. If Type(unscopables) is Object, then
      1. Let isBlocked be HasProperty(unscopables, N).
      2. ReturnIfAbrupt(isBlocked).
    5. If isBlocked is false, then
      1. Return Get(bindings, N).
  6. If S is false, return the value undefined, otherwise throw a ReferenceError exception.

8.1.2.3 NewObjectEnvironment (O, E) Abstract Operation

When the abstract operation NewObjectEnvironment is called with an Object O and a Lexical Environment E (or null) as arguments, the following steps are performed:

  1. Let env be a new Lexical Environment.
  2. Let envRec be a new object environment record containing O as the binding object.
  3. Set env’s environment record to envRec.
  4. Set the outer lexical environment reference of env to E.
  5. Return env.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment