mooz/js2-mode — Issue #21: "use strict" is highlighted as an error
Author: magnars
Created: 2011-11-07 10:28:05+00:00
State: open

Since the stand-alone `"use strict"` declaration has no side effects, it is marked as an error by js2-mode.

From http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/

> Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a "strict" operating context. This strict context prevents certain actions from being taken and throws more exceptions.
>
> Strict mode helps out in a couple ways:
>
> * It catches some common coding bloopers, throwing exceptions.
> * It prevents, or throws errors, when relatively "unsafe" actions are taken (such as gaining access to the global object).
> * It disables features that are confusing or poorly thought out.