gkz / grasp

JavaScript structural search, replace, and refactor
http://graspjs.com
MIT License
1.28k stars 33 forks source link

What is type: 'Raw' !? #110

Open kristianmandrup opened 7 years ago

kristianmandrup commented 7 years ago

Trying to debug and understand how to use the append filter in order to add a method to a class body. I see that results is an Array of AST nodes. What is appended (pushed) is:

{ type: 'Raw', raw: '5' }

So what is valid in this context!?


  Node {
    type: 'Literal',
    start: 7,
    end: 8,
    loc: SourceLocation { start: [Object], end: [Object] },
    value: 4,
    raw: '4' } ] ARGS: [ 5, 6 ]
resultNode { type: 'Raw', raw: '5' }