You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jeisinger can you think of anything that might have changed between 4.2 and 4.3 regarding ObjectTemplate::SetNamedPropertyHandler and friends that would change a
foo.bar = 5;
^
ReferenceError: foo is not defined
to a
foo.bar = 5;
^
TypeError: Cannot set property 'bar' of undefined
constbinding=process.binding('contextify');constcontext={};binding.makeContext(context);constscript=newbinding.ContextifyScript('foo;');varfoo=script.runInContext(context);// should throw an exceptionconsole.log(foo);// logs undefined
My guess is that something in the Local -> MaybeLocal transition made it so that errors get swallowed unless you're more careful about things?
OK, I can fix the second test case, by ensuring GlobalPropertyQueryCallback returns an empty handle if there is no property, instead of returning None. (This appears to be a V8 change.)
The first test case (and the one in the OP) is less tractable. I am debugging through GlobalPropertyGetterCallback and it seems like while the sandbox gives back an empty handle, the proxy global does not. I wonder if there was some change in V8 semantics such that global objects for contexts now return undefined instead of empty handles when calling GetRealNamedProperty ??
The line if (!it.IsFound()) return MaybeLocal<Value>(); is incorrect, because it is still in its initial state. It should be after the call to i::Object::GetProperty(&it).
Reported at https://code.google.com/p/v8/issues/detail?id=4143. If someone else wants to give a patch a try, that'd be great, as I already took much of today to work on io.js and I should go back to Chrome soon.
Closing since this is fixed in next via the floating patch (70716fd). We should also update V8 in next to the latest branch head though so we can stop floating the patch; I will open a separate issue.
Activity
domenic commentedon May 22, 2015
@jeisinger can you think of anything that might have changed between 4.2 and 4.3 regarding ObjectTemplate::SetNamedPropertyHandler and friends that would change a
to a
?
domenic commentedon May 23, 2015
Barest-bones repro on top of contextify:
My guess is that something in the Local -> MaybeLocal transition made it so that errors get swallowed unless you're more careful about things?
domenic commentedon May 23, 2015
Another repro:
This implies it's less about exceptions and more about screwing up the callbacks to somehow always signal something is present/undefined.
domenic commentedon May 23, 2015
OK, I can fix the second test case, by ensuring GlobalPropertyQueryCallback returns an empty handle if there is no property, instead of returning None. (This appears to be a V8 change.)
The first test case (and the one in the OP) is less tractable. I am debugging through GlobalPropertyGetterCallback and it seems like while the sandbox gives back an empty handle, the proxy global does not. I wonder if there was some change in V8 semantics such that global objects for contexts now return undefined instead of empty handles when calling GetRealNamedProperty ??
domenic commentedon May 23, 2015
At this point I am 90% sure this is a V8 bug caused by this commit v8/v8@6130b02
The new code for GetRealNamedProperty is as follows:
The line
if (!it.IsFound()) return MaybeLocal<Value>();is incorrect, becauseitis still in its initial state. It should be after the call toi::Object::GetProperty(&it).Reported at https://code.google.com/p/v8/issues/detail?id=4143. If someone else wants to give a patch a try, that'd be great, as I already took much of today to work on io.js and I should go back to Chrome soon.
targos commentedon May 26, 2015
It has just been fixed in master v8/v8@7b24219
jeisinger commentedon May 26, 2015
I'll merge that soon to 4.4 and 4.3
rvagg commentedon May 27, 2015
#1805 floated that patch, looking good sans a couple of odd failures
domenic commentedon Jun 5, 2015
Closing since this is fixed in next via the floating patch (70716fd). We should also update V8 in next to the latest branch head though so we can stop floating the patch; I will open a separate issue.