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

Function visitClassMethod

lib/assets/javascripts/JSXTransformer.js:13679–13695  ·  view source on GitHub ↗

* @param {function} traverse * @param {object} node * @param {array} path * @param {object} state

(traverse, node, path, state)

Source from the content-addressed store, hash-verified

13677 * @param {object} state
13678 */
13679function visitClassMethod(traverse, node, path, state) {
13680 if (!state.g.opts.es5 && (node.kind === 'get' || node.kind === 'set')) {
13681 throw new Error(
13682 'This transform does not support ' + node.kind + 'ter methods for ES6 ' +
13683 'classes. (line: ' + node.loc.start.line + ', col: ' +
13684 node.loc.start.column + ')'
13685 );
13686 }
13687 state = utils.updateState(state, {
13688 methodNode: node
13689 });
13690 utils.catchup(node.range[0], state);
13691 path.unshift(node);
13692 traverse(node.value, path, state);
13693 path.shift();
13694 return false;
13695}
13696visitClassMethod.test = function(node, path, state) {
13697 return node.type === Syntax.MethodDefinition;
13698};

Callers

nothing calls this directly

Calls 1

traverseFunction · 0.85

Tested by

no test coverage detected