Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/detectStrictMode.js')
-rw-r--r--lib/detectStrictMode.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/detectStrictMode.js b/lib/detectStrictMode.js
index 347c455..35f27fb 100644
--- a/lib/detectStrictMode.js
+++ b/lib/detectStrictMode.js
@@ -2,11 +2,11 @@
* Returns true if the source code is intended to run in strict mode. Does not detect
* "use strict" if it occurs in a nested function.
*
- * @param {!String} src
+ * @param {String} src
* @return {Boolean}
*/
function detectStrictMode(src) {
- return (/^\s*"use strict";/g).test(src);
+ return (/^\s*(?:"use strict"|'use strict')[ \t]*(?:[\r\n]|;)/g).test(src);
}
module.exports = detectStrictMode; \ No newline at end of file