Bug 389241 - [Client] Consider using strict mode for RWT javascript core
Summary: [Client] Consider using strict mode for RWT javascript core
Status: NEW
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-11 08:09 EDT by Tim Buschtoens CLA
Modified: 2012-09-11 09:35 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Buschtoens CLA 2012-09-11 08:09:47 EDT
Strict mode is a ECMAScript 1.5 feature that prevents some common javascript mistakes. We should consider using it for our RWT javascript code, but not enable it for contributions (like clientscripting).

More info can be found here:
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode

Currently script mode fails because we create global variables. Those would have to be created using "window.rwt = {};" I would also suggest to wait for the IE 10 release, to see if and how it's supported there.

ClientScripting in it's current state might not work in strict mode due in the changes on eval behavior.
Comment 1 Ivan Furnadjiev CLA 2012-09-11 08:48:23 EDT
Tim, could we consider this bug as duplicate of bug 363494?
Comment 2 Tim Buschtoens CLA 2012-09-11 09:35:04 EDT
I thought there already was a bug, but i didn't consider searching closed bugs. We could mark this a dup and re-open the original bug or leave it as is. Either way, the original argument regarding "arguments.callee" is a valid concern, but i think we can work around that.