for-of should throw if result object is not an object
authorarv <arv@chromium.org>
Mon, 23 Feb 2015 23:34:26 +0000 (15:34 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 23 Feb 2015 23:34:38 +0000 (23:34 +0000)
commit87f77d6abaf8746719ae1f53b9eb61c1d1cf6a0b
tree76d6a45ba5e0f2faffc255d7c4a72f5e6ea79529
parentf8abac93311b441d241fbf4898ea106e84bcffac
for-of should throw if result object is not an object

This is done using desugaring. Before this we had:

  result = iterator.next()

with this we instead do:

  !%_IsSpecObject(result = iterator.next()) &&
      %ThrowIteratorResultNotAnObject(result)

BUG=v8:3916
LOG=N

Review URL: https://codereview.chromium.org/929733003

Cr-Commit-Position: refs/heads/master@{#26805}
src/ast-value-factory.h
src/ast.h
src/parser.cc
src/runtime/runtime-internal.cc
src/runtime/runtime.h
test/mjsunit/es6/iteration-semantics.js