Add {Map,Set}::AsArray to the API
authoradamk <adamk@chromium.org>
Tue, 26 May 2015 18:13:22 +0000 (11:13 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 26 May 2015 18:13:32 +0000 (18:13 +0000)
commita8d9c58b1f618f518dc3a5a73023e6847544979f
treee90a6e1ec84cfedcbe400eec8391664053876330
parent28cea2b749f24ba33e6e0c8e343dd0d6258ee302
Add {Map,Set}::AsArray to the API

These return arrays representing the current contents of the given
Map/Set. They are similar to what would be returned by the JS code:

  Array.from(collection)

except that they are guaranteed side-effect free.

This will be useful in implementing structured clone which, as
specified in HTML, speaks in terms of the internal [[MapData]]
and [[SetData]] slots without going through the exposed iteration
ES semantics.

BUG=v8:3340
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#28640}
include/v8.h
src/api.cc
test/cctest/test-api.cc