Skip to content

Commit

Permalink
Proxy [[Enumerate]]: exhaust iterator and throw on non-strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgNeis committed Jan 13, 2016
1 parent 3fe4897 commit 683120d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -8639,7 +8639,15 @@ <h1>[[Enumerate]] ()</h1>
1. Return ? _target_.[[Enumerate]]().
1. Let _trapResult_ be ? Call(_trap_, _handler_, &laquo; _target_ &raquo;).
1. If Type(_trapResult_) is not Object, throw a *TypeError* exception.
1. Return _trapResult_.
1. Let _array_ be ArrayCreate(0).
1. Let _nextIndex_ be 0.
1. Repeat
1. Let _next_ be ? IteratorStep(_trapResult_).
1. If _next_ is *false*, return CreateArrayIterator(_array_, `"value"`).
1. Let _nextValue_ be ? IteratorValue(_next_).
1. If Type(_nextValue_) is not String, throw a *TypeError* exception.
1. Perform ! CreateDataPropertyOrThrow(_array_, ToString(ToUint32(_nextIndex_)), _nextValue_).
1. Let _nextIndex_ be _nextIndex_ + 1.
</emu-alg>
<emu-note>
<p>[[Enumerate]] for proxy objects enforces the following invariants:</p>
Expand Down

0 comments on commit 683120d

Please sign in to comment.