Fix toString() behavior on proxy objects.
Proxy objects need special treatment in toString(). Usually, we use the @@toStringTag, if it is set, otherwise we determine the result of toString() by checking IsArray() and other internal slots. According to ES2017 19.1.3.6, IsArray() and the internal slots must be checked first, then get(@@toStringTag). The result of IsArray() and internal slots is discarded if @@toStringTag is set. For proxy objects, we must obey this order, because get() can have side-effects, i.e., revoke the proxy. For all other objects, we can skip the check of the internal slots, if @@toStringTag is set. BUG= CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel Review-Url: https://codereview.chromium.org/2090773006 Cr-Commit-Position: refs/heads/master@{#37289}
Showing
Please
register
or
sign in
to comment