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/__get__.js')
-rw-r--r--lib/__get__.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/__get__.js b/lib/__get__.js
index 74e652f..cb6fe68 100644
--- a/lib/__get__.js
+++ b/lib/__get__.js
@@ -1,21 +1,21 @@
-/**
- * This function will be stringified and then injected into every rewired module.
- * Then you can leak private variables by calling myModule.__get__("myPrivateVar");
- *
- * All variables within this function are namespaced in the arguments array because every
- * var declaration could possibly clash with a variable in the module scope.
- *
- * @param {!String} name name of the variable to retrieve
- * @throws {TypeError}
- * @return {*}
- */
-function __get__() {
- arguments.varName = arguments[0];
- if (arguments.varName && typeof arguments.varName === "string") {
- return eval(arguments.varName);
- } else {
- throw new TypeError("__get__ expects a non-empty string");
- }
-}
-
+/**
+ * This function will be stringified and then injected into every rewired module.
+ * Then you can leak private variables by calling myModule.__get__("myPrivateVar");
+ *
+ * All variables within this function are namespaced in the arguments array because every
+ * var declaration could possibly clash with a variable in the module scope.
+ *
+ * @param {!String} name name of the variable to retrieve
+ * @throws {TypeError}
+ * @return {*}
+ */
+function __get__() {
+ arguments.varName = arguments[0];
+ if (arguments.varName && typeof arguments.varName === "string") {
+ return eval(arguments.varName);
+ } else {
+ throw new TypeError("__get__ expects a non-empty string");
+ }
+}
+
module.exports = __get__; \ No newline at end of file