MCPcopy Create free account
hub / github.com/reactjs/react-rails / _nodeIsClosureScopeBoundary

Function _nodeIsClosureScopeBoundary

lib/assets/javascripts/JSXTransformer.js:12288–12304  ·  view source on GitHub ↗

* @param {object} node * @param {object} parentNode * @return {boolean}

(node, parentNode)

Source from the content-addressed store, hash-verified

12286 * @return {boolean}
12287 */
12288function _nodeIsClosureScopeBoundary(node, parentNode) {
12289 if (node.type === Syntax.Program) {
12290 return true;
12291 }
12292
12293 var parentIsFunction =
12294 parentNode.type === Syntax.FunctionDeclaration
12295 || parentNode.type === Syntax.FunctionExpression
12296 || parentNode.type === Syntax.ArrowFunctionExpression;
12297
12298 var parentIsCurlylessArrowFunc =
12299 parentNode.type === Syntax.ArrowFunctionExpression
12300 && node === parentNode.body;
12301
12302 return parentIsFunction
12303 && (node.type === Syntax.BlockStatement || parentIsCurlylessArrowFunc);
12304}
12305
12306function _nodeIsBlockScopeBoundary(node, parentNode) {
12307 if (node.type === Syntax.Program) {

Callers 1

traverseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected