I agree, having a function that doesn't close over its lexical environment
is
weird. But having to write the Worker as a string is pretty horrible.
Perhaps you're right that it's better to make the stringification of the
function explicit. I'm happy to do that in the next CL if everyone prefers
it.
https://codereview.chromium.org/1216023003/diff/20001/test/mjsunit/d8-worker-sharedarraybuffer.js
File test/mjsunit/d8-worker-sharedarraybuffer.js (right):
https://codereview.chromium.org/1216023003/diff/20001/test/mjsunit/d8-worker-sharedarraybuffer.js#newcode31
test/mjsunit/d8-worker-sharedarraybuffer.js:31: function f() {
On 2015/06/30 at 17:42:43, jarin wrote:
I do not think this is doing what you think it's doing. E.g.
var x = false;
if (x) function f() { print("f"); }
f();
still happily prints f.
You really have to say
var f = function () { ... }
Even then I am not entirely sure why this has to be conditioned on
this.Worker being defined?
Oh, I wasn't trying to prevent the definition of f, it's just that
sometimes Worker isn't defined, so I was wrapping the whole test in the
Worker check. I'll move f out to make that clearer.
https://codereview.chromium.org/1216023003/diff/20001/test/mjsunit/d8-worker-sharedarraybuffer.js#newcode36
test/mjsunit/d8-worker-sharedarraybuffer.js:36: throw new
Error("SharedArrayBuffer transfer byteLength");
On 2015/06/30 at 17:42:43, jarin wrote:
Nit: Could we get the braces here and below? (In general, we like
braces if the body is not on the same line.)
Done.
https://codereview.chromium.org/1216023003/diff/20001/test/mjsunit/d8-worker-sharedarraybuffer.js#newcode55
test/mjsunit/d8-worker-sharedarraybuffer.js:55: assertEquals(16,
sab.byteLength); // ArrayBuffer should not neutered.
On 2015/06/30 at 17:42:43, jarin wrote:
In the comment: ... should not *be* neutered.
Done.
https://codereview.chromium.org/1216023003/diff/20001/test/mjsunit/d8-worker-sharedarraybuffer.js#newcode63
test/mjsunit/d8-worker-sharedarraybuffer.js:63: w.terminate();
On 2015/06/30 at 17:42:43, jarin wrote:
Could we also check that the array has not been neutered after
termination?
Done.
https://codereview.chromium.org/1216023003/
--
--
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.