Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13317 closed defect (fixed)

MVC deprecated usage of eval()

Reported by: bill Owned by: rahul
Priority: high Milestone: 1.7
Component: DojoX MVC Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Loading demos/mobileMvc/demo.html on FF5 gives an exception in _Container.js on the line:

return eval(exp, pThis)

The warning is that:

Support for eval(code, scopeObject) has been removed. Use |with (scopeObject) eval(code);| instead.

(There might be other FF5 problems too.)

Attachments (1)

13317.diff (430 bytes) - added by ben hockey 8 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 8 years ago by Ed Chatelain

Hi Bill, I am not getting the exception with FF5, I tested with FF 5.0 on Mac and Windows and both worked fine with: return eval(exp, pThis);

I can change it to use: with (pThis) {return eval(exp);};

But I am not sure why I am not seeing the error.

comment:2 Changed 8 years ago by bill

Probably, you don't have Firebug 1.8.4 installed and enabled? The error only seems to show up then, not sure why.

comment:3 Changed 8 years ago by Ed Chatelain

I was able to see the problem when I turned on the Console option to Show JavaScript? Warnings. It was actually a warning rather than an error. I made the change in ticket #13230 to use: with (pThis) {return eval(exp);}; All of the mvc tests passed, and the warning is gone, so I think this ticket can be closed, but I don't have permissions to close it. Thanks

comment:4 Changed 8 years ago by bill

Description: modified (diff)
Milestone: tbd1.7
Resolution: fixed
Status: newclosed
Summary: MVC broken on FF5, eval() callMVC deprecated usage of eval()

Thanks, you are right, and after your fix the warning goes away for me. Closing this and updating summary/description.

comment:5 Changed 8 years ago by ben hockey

Resolution: fixed
Status: closedreopened

missed the eval in dojo/mvc/Output

comment:6 Changed 8 years ago by ben hockey

err... dojox/mvc/Output

Changed 8 years ago by ben hockey

Attachment: 13317.diff added

comment:7 Changed 8 years ago by ben hockey

can someone please test the attached patch? i seem to have trouble getting the tests to pass before i apply it.

comment:8 Changed 8 years ago by Ed Chatelain

Hi Ben, with your patch this one test failed: dojox.mvc.tests.doh_mvc_binding-simple

If you leave the with (pThis) {return eval(exp)
"" it works, like this:
"";};

Thanks, Ed

comment:9 Changed 8 years ago by ben hockey

Resolution: fixed
Status: reopenedclosed

(In [25680]) change deprecated use of eval. fixes #13317 !strict

comment:10 Changed 8 years ago by ben hockey

thanks ed. i had just done a copy/paste of the other change and missed the subtle difference.

Note: See TracTickets for help on using tickets.