@jdeighan/coffee-utils 7.0.62 → 7.0.63
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/coffee_utils.coffee +7 -0
- package/src/coffee_utils.js +6 -0
package/package.json
CHANGED
package/src/coffee_utils.coffee
CHANGED
@@ -21,6 +21,13 @@ export isComment = (line) ->
|
|
21
21
|
|
22
22
|
# ---------------------------------------------------------------------------
|
23
23
|
|
24
|
+
export eval_expr = (str) ->
|
25
|
+
|
26
|
+
str = str.replace(/\bundef\b/g, 'undefined')
|
27
|
+
return Function('"use strict";return (' + str + ')')();
|
28
|
+
|
29
|
+
# ---------------------------------------------------------------------------
|
30
|
+
|
24
31
|
export haltOnError = () ->
|
25
32
|
|
26
33
|
doHaltOnError = true
|
package/src/coffee_utils.js
CHANGED
@@ -23,6 +23,12 @@ export var isComment = function(line) {
|
|
23
23
|
return defined(lMatches);
|
24
24
|
};
|
25
25
|
|
26
|
+
// ---------------------------------------------------------------------------
|
27
|
+
export var eval_expr = function(str) {
|
28
|
+
str = str.replace(/\bundef\b/g, 'undefined');
|
29
|
+
return Function('"use strict";return (' + str + ')')();
|
30
|
+
};
|
31
|
+
|
26
32
|
// ---------------------------------------------------------------------------
|
27
33
|
export var haltOnError = function() {
|
28
34
|
return doHaltOnError = true;
|