Just now, the fast path assumes you never throw, and you don't care much
about
the previous attribute values, since before strong mode it was impossible to
fail to set writable/enumerable attribute to false. I think it's possible to
modify the fast path to work, but it requires inspecting the previous value
in
more detail than is done currently. Forcing the slow path was an easier fix.
I've added a todo, which is consistent with Andreas' treatment of forcing
normally shallow copied strong arrays to take the slow path.
https://codereview.chromium.org/1142393003/diff/60001/test/mjsunit/strong/object-freeze-property.js
File test/mjsunit/strong/object-freeze-property.js (right):
https://codereview.chromium.org/1142393003/diff/60001/test/mjsunit/strong/object-freeze-property.js#newcode22
test/mjsunit/strong/object-freeze-property.js:22: return [({})];
On 2015/05/28 15:51:51, arv wrote:
no need for parens here.
Done.
https://codereview.chromium.org/1142393003/diff/60001/test/mjsunit/strong/object-freeze-property.js#newcode30
test/mjsunit/strong/object-freeze-property.js:30:
Object.defineProperty(o, "foo", { configurable:true, writable:true });
On 2015/05/28 15:51:51, arv wrote:
{configurable: true, writable: true}
Done.
https://codereview.chromium.org/1142393003/diff/60001/test/mjsunit/strong/object-freeze-property.js#newcode31
test/mjsunit/strong/object-freeze-property.js:31: assertDoesNotThrow(
On 2015/05/28 15:51:51, arv wrote:
assertDoesNotThrow is generally pretty useless... consider changing to
an IIFE.
Since this would throw if it was a strong object, I think it gives
better messaging in the error case that the strong semantics are
accidently invoked here.
https://codereview.chromium.org/1142393003/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.