How to use the escodegen/node_modules/estraverse.Syntax function in escodegen

To help you get started, we’ve selected a few escodegen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dritchie / probabilistic-js / probabilistic / transform.js View on Github external
enter: function(node)
	{
		if (!node.skip && node.type == estraverse.Syntax.CallExpression)
		{
			var replacer = makeWrappedCallReplacer(node)
			var wrapast = esprima.parse(replcode.format(nextid)).body[0].expression
			nextid++

			// We do NOT wrap the calls to enterfn, the fn itself, or leavefn
			wrapast.callee.object.body.body[0].expression.skip = true
			node.skip = true
			wrapast.callee.object.body.body[2].expression.skip = true

			// To preserve source map information 
			wrapast.loc = node.loc
			wrapast.callee.object.body.body[1].loc = node.callee.loc

			estraverse.replace(wrapast, replacer)
github probmods / webchurch / src / probabilistic-js / probabilistic / transform.js View on Github external
enter: function(node)
	{
		if (!node.skip && node.type == estraverse.Syntax.CallExpression)
		{
			var replacer = makeWrappedCallReplacer(node)
			var wrapast = esprima.parse(replcode.format(nextid)).body[0].expression
			nextid++

			// We do NOT wrap the calls to enterfn, the fn itself, or leavefn
			wrapast.callee.object.body.body[0].expression.skip = true
			node.skip = true
			wrapast.callee.object.body.body[2].expression.skip = true

			// To preserve source map information 
			wrapast.loc = node.loc
			wrapast.callee.object.body.body[1].loc = node.callee.loc

			estraverse.replace(wrapast, replacer)
github dritchie / probabilistic-js / probabilistic / transform.js View on Github external
enter: function(node)
		{
			if (node.type == estraverse.Syntax.Identifier &&
				node.name == "__p_REPLACEME_p__")
			{
				return callNode
			}
			return node
		}
	}
github probmods / webchurch / src / wctransform.js View on Github external
enter: function(node)
          {
            if (node.type == estraverse.Syntax.Identifier &&
                node.name == '__REPLACEME__')
            {
              return replacenode;
            }
            return node;
          }
        };
github probmods / webchurch / wctransform.js View on Github external
enter: function(node)
	    {
		if (node.type == estraverse.Syntax.Identifier &&
		    node.name == "__REPLACEME__")
		{
		    return replacenode
		}
		return node
	    }
	}
github probmods / webchurch / src / probabilistic-js / probabilistic / transform.js View on Github external
enter: function(node)
		{
			if (node.type == estraverse.Syntax.Identifier &&
				node.name == "__p_REPLACEME_p__")
			{
				return callNode
			}
			return node
		}
	}