0


While with spidermonkey 1.7 this object was working as expected in functions, with 1.8.5 always defaults to global object.

I am evaluating scripts to specific object and i expect this to be that object in functions as it did with 1.7.

for example

function dummy()
{
  alert("This: "+this);
}

with 1.7 will display "This: [object doc]"
1.8.5 will "This: [object global]"

Spidermonkey api call is made like:
JS_EvaluateUCScript(Ctx, jsobj, Code, Length(Code), nil, 0, nil) where jsobj is an object other than global object

n.amelad
  • 1
  • 1
  • The underlying behaviour is identical. They've just improved the message that gets reported. – Beetroot-Beetroot Jun 26 '13 at 11:20
  • I was misuse api call JS_SetOptions(.., JSOPTION_VAROBJFIX | xxxx); JSOPTION_VAROBJFIX should not be set, after removing i end up with 1.7 behavior – n.amelad Jun 26 '13 at 12:54

0 Answers0