“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!

This blog is permanently closed.

For up-to-date information please follow to corresponding WebStorm blog or PhpStorm blog.

 
This entry was posted in Cool Feature, PhpStorm, WebStorm and tagged , , , , . Bookmark the permalink.

14 Responses to “use strict” from EcmaScript 5 is supported in WebStorm / PhpStorm!

  1. Dylan Greene says:

    The 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/

  2. nikic says:

    Is this already available in an EAP? At least I don’t get those things marked as errors in 102.114.

  3. nicity says:

    It should be available in the latest EAP, to check please paste
    following code to separate js file:
    function foo() {
    “use strict”;
    a = 1;
    }

  4. nikic says:

    Yep, that works. Probably my old code simply wasn’t reindexed or whatever.

    Thanks for that :) JavaScript support is awesom in PHPStorm :)

  5. nicity says:

    Please file bugs in YouTrack if it will not work in particular contexts

  6. nicity says:

    to Dilan: yes, v8 engine has implemented EcmaScript5 standard library and latter is used in NodeJS and related packages

  7. Bryan Green says:

    The 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?

  8. Bryan Green says:

    Regarding search – - Eventually, phpstorm just runs out of memory (XMX as 970MB and XX:MaxPermSize at 500MB)

  9. Simon says:

    Keep up you fantastic work, phpStorm/webStorm rocks.

  10. nicity says:

    2Bryan Green please report bugs to YouTrack providing additional information specified in http://devnet.jetbrains.net/docs/DOC-192

  11. David Rees says:

    @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.

  12. David Rees says:

    One 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

  13. nicity says:

    2David latest EAP (103.43) places Object below all user typed ones

  14. mark foley says:

    Hi – 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

Comments are closed.