continuation.js
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "continuation.js", | ||
"description": "Continuation support for Node.js", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"author": "Daishi Kato <daishi@axlight.com>", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
@@ -71,4 +71,3 @@ continuation.js | ||
* Work with increment expression ex. `i++` | ||
* Work with try...catch | ||
* Work with try...catch, throw. | ||
* Better documents. | ||
@@ -75,0 +74,0 @@ * Transform non-tail calls into CPS. |
@@ -219,6 +219,21 @@ /* | ||
root.convert_function_call_to_new_cps_call = function(exclude_ids, body) { | ||
var has_side_effect = function(node) { | ||
if (node && node.type === 'CallExpression') { | ||
return true; | ||
} else if (node && node.type === 'UpdateExpression') { | ||
return true; | ||
} else if (node && node.type === 'AssignmentExpression') { | ||
return true; | ||
} else if (node && node.type === 'NewExpression') { | ||
return true; | ||
} else if (node instanceof Object) { | ||
return _.some(node, has_side_effect); | ||
} else { | ||
return false; | ||
} | ||
}; | ||
var walk = function(node) { | ||
if (node && (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression')) { | ||
return; | ||
} else if (node && node.type === 'CallExpression' && node.callee && !(node.callee.type === 'Identifier' && node.callee.name === 'CpsEnableWrapper')) { | ||
} else if (node && node.type === 'CallExpression' && node.callee && !has_side_effect(node.callee) && !(node.callee.type === 'Identifier' && node.callee.name === 'CpsEnableWrapper')) { | ||
var kk_varname = root.generate_new_variable_name('kk', exclude_ids); | ||
@@ -225,0 +240,0 @@ var cpsnode = root.deep_clone(node); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114658
2446
78