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:
authorJohannes <johannes.ewald@roomieplanet.de>2012-06-23 18:07:15 +0400
committerJohannes <johannes.ewald@roomieplanet.de>2012-06-23 18:07:15 +0400
commit2c8949bffba28b5d0e6953d804e9fbb6725fb38e (patch)
treebc31b6eab3eeb39620adc795a5350922d77709e8 /lib/detectStrictMode.js
parentd432d902513b69eb216c95505f755f616b9cf698 (diff)
added comments
Diffstat (limited to 'lib/detectStrictMode.js')
-rw-r--r--lib/detectStrictMode.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/detectStrictMode.js b/lib/detectStrictMode.js
index d0107d0..347c455 100644
--- a/lib/detectStrictMode.js
+++ b/lib/detectStrictMode.js
@@ -1,3 +1,10 @@
+/**
+ * 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
+ * @return {Boolean}
+ */
function detectStrictMode(src) {
return (/^\s*"use strict";/g).test(src);
}