“use strict” from EcmaScript 5 is supported in WebStorm / PhpStorm!
Recently JavaScript specification was incrementally advanced with: a) common coding pitfalls prevention mode (aka “strict mode“) and b) nice (yet de-facto already used) existing library additions. With several browsers around the corner completely supporting new-but-backward-compatible standard we are HAPPY to announce that WebStorm 2.0 (and PhpStorm 2.0 too) will help YOU to use these new productive stuff! The good news is that when your code uses “use strict” (example on the left), the editor will mark as ERRORS all that accesses of undefined global variables, duplicated parameters / property names, using with statements, using delete operator for unqualified variables, octal integer constants and more. As to standard library additions, all that new Object/Array members should have been suggested for latest EAP version users. What is new is that editor knows about fields defined with methods like Object.defineProperty, e.g. as on example screenshot below.
We are waiting for EAP version feedback. Develop your JavaScript with more pleasure!
Dylan Greene says:
January 13, 2011The second screenshot is from npm. Could this be an early hint of Node support?
Node.js support request:
http://youtrack.jetbrains.net/issue/WI-3451
NPM:
http://npmjs.org/
nikic says:
January 14, 2011Is this already available in an EAP? At least I don’t get those things marked as errors in 102.114.
nicity says:
January 15, 2011It should be available in the latest EAP, to check please paste
following code to separate js file:
function foo() {
“use strict”;
a = 1;
}
nikic says:
January 15, 2011Yep, that works. Probably my old code simply wasn’t reindexed or whatever.
Thanks for that 🙂 JavaScript support is awesom in PHPStorm 🙂
nicity says:
January 15, 2011Please file bugs in YouTrack if it will not work in particular contexts
nicity says:
January 17, 2011to Dilan: yes, v8 engine has implemented EcmaScript5 standard library and latter is used in NodeJS and related packages
Bryan Green says:
January 19, 2011The current beta seems to be hanging on search on very large javascript files. I have a js minimized file and searching gets hung BIG TIME on this file. I can send this your way if you want. This may have been present in the last release or two – unsure. Do you need me to create a ticket?
Bryan Green says:
January 19, 2011Regarding search – – Eventually, phpstorm just runs out of memory (XMX as 970MB and XX:MaxPermSize at 500MB)
Simon says:
January 20, 2011Keep up you fantastic work, phpStorm/webStorm rocks.
nicity says:
January 20, 20112Bryan Green please report bugs to YouTrack providing additional information specified in http://devnet.jetbrains.net/docs/DOC-192
David Rees says:
January 31, 2011@Bryan Green, this issue you were seeing may have been fixed in the last EAP (WS103.8), see http://youtrack.jetbrains.net/issue/WI-4679.
David Rees says:
January 31, 2011One problem with the ECMA5 support is all the ECMA5 Object variants crowd out the other variants in code completion suggestions. See the following feature requests for fixing this:
http://youtrack.jetbrains.net/issue/WI-4975
ability to indicate JS version or at least turnoff ECMAScript5.js suggestions
http://youtrack.jetbrains.net/issue/WI-4973
Ability to order JS code completion suggestions by inheritance order rather than alphabetical order
http://youtrack.jetbrains.net/issue/WI-4974
add option to filter system or top-level variants in JS code completion
nicity says:
February 2, 20112David latest EAP (103.43) places Object below all user typed ones
mark foley says:
February 9, 2012Hi – I just registered webstorm 3, and searched the net for ‘option explicit for javascript’. Came across this and it’s the best news I’ve heard so far for making JS easier to work with!
Cheers