Commit 2de49e2
authored
feat: add parent pointers to nodes and a traverse function (#251)
Also throw in some other breaking changes and other cleanups.
BREAKING CHANGE: All nodes now have a `parentNode` field.
Shorthand object initializers now have a `null` value rather than using the same
node as the key and the value. This ensures no node gets traversed twice in a
traversal.
The `range` field has been removed from nodes. Code should now use `start` and
`end` instead.1 parent 17651ec commit 2de49e2
File tree
275 files changed
+3652
-7447
lines changed- src
- mappers
- test
- examples
- addition
- array-with-multiple-members
- array-with-single-member
- assign
- backticks-with-string-inside
- bitshift-left
- bitshift-right-unsigned
- bitshift-right
- bitwise-and
- bitwise-or
- bitwise-xor
- block-comment-in-function
- block-comment-only-file
- block-comment
- bound-function-with-parameters
- bound-generator-function
- break
- call-dynamic-member-access-result
- chain-calls-with-parens
- chain-calls-without-indent
- chain-calls-without-parens
- chained-comparison-equals
- chained-comparison-extended
- chained-comparison-greater-than
- chained-comparison-less-than
- chained-comparison-mixed
- chained-comparison-nested
- chained-comparison-not-equal
- chained-comparison-three
- chained-comparison-with-increment
- chained-comparison-with-other-operators
- chained-comparison-with-unary-negate
- chained-prototype-member-access
- class-extends
- class-member-with-block-comment
- class-super-call
- class-with-body-statements
- class-with-bound-methods
- class-with-conditional-bound-method
- class-with-conditional-method
- class-with-constructor
- class-with-explicit-object-literal
- class-with-implicit-object-literal-within-function
- class-with-members
- class-with-outer-assign-blocking-conditional-assign
- class-with-parenthesized-value
- class-with-proto-access-name
- class-with-static-members
- comment-only-file
- complex-template-literal
- compound-assignment-addition
- compound-assignment-subtraction
- conditional-empty-consequent-alternate
- conditional-ending-in-semicolon
- conditional-on-one-line
- conditional-unless-equal-condition
- conditional-unless-exists-op
- conditional-unless-virtual-parens
- conditional-using-unless
- conditional-with-alternate
- conditional-with-braces-on-one-line
- conditional-with-post-if
- conditional-with-post-unless
- conditional-without-alternate
- continue
- dangling-prototype-access-of-call
- dangling-prototype-access
- delete
- destructure-this-assignment
- division
- do-expression
- do-with-assign-and-defaults
- do-with-assign-expression
- do-with-bound-function
- do-with-default-parameters
- do-with-defaults-with-same-name
- do-with-simple-parameters
- double-negation
- do
- dynamic-member-expressions
- empty-anonymous-class
- empty-array
- empty-bound-function-without-body
- empty-class-with-superclass
- empty-class
- empty-function-without-parameters
- empty-heregex-interpolation
- empty-loop
- empty-object
- empty-program
- empty-string-interpolation
- equality-longhand
- equality
- existential-binary
- existential-unary
- expansion
- external-constructor
- false
- float-int-value
- float-leading-period
- float
- floor-division
- for-comprehension
- for-in-by
- for-in-when
- for-in-with-key-and-value-assignees
- for-in
- for-of-expression
- for-of-when
- for-of-with-key-and-value-assignees
- for-of
- for-own-of
- for-repeater
- function-ending-in-block-comment
- function-ending-in-semicolon
- function-followed-by-block-comment
- function-trailing-spaces
- function-with-body
- function-with-default-parameter
- function-with-parameters
- function-with-statement-after-block-and-comments
- greater-than-equal
- greater-than
- heregex-in-method-call
- heregex-with-flags
- heregex-with-interpolations-and-flags
- heregex-with-interpolations
- heregex-with-spaces-and-comments
- heregex-with-strange-whitespace
- heregex
- hexidecimal-number
- iife-in-function-call
- in-not
- instanceof-not
- instanceof
- integer
- in
- js
- keyword-member-access
- less-than-equal
- less-than
- logical-and-longform
- logical-and
- logical-or-longform
- logical-or
- loop
- many-expressions-in-parens
- modulo
- multiline-interpolated-string-with-escaped-newline
- multiline-string-with-interpolations-and-quotes
- multiline-string-with-quoted-interpolations-and-non-interpolations
- multiple-expressions-in-parens
- multiplication
- negated-equality-longhand
- negated-equality
- negation-with-not
- negation
- nested-code-with-outdent
- nested-conditionals
- nested-member-expressions
- nested-object-literals
- nested-string-interpolation
- new-with-method-call
- new-without-parens
- new
- null
- number-object-key
- object-destructure-with-default
- object-with-block-comments
- object-with-braces
- object-with-combined-key-value
- object-with-multiple-properties
- object-with-parenthesized-value
- object-without-braces
- octal-number
- of-not
- of
- only-empty-string-interpolation
- parentheses
- parenthesized-member-access
- post-decrement
- post-for
- post-increment
- post-unless-not-if
- post-while-with-loop
- pow
- pre-decrement
- pre-increment
- prototype-member-access
- range-exclusive
- range-inclusive
- regexp
- remainder
- rest-param-in-bound-function
- rest-param-in-function
- return-with-expression
- return-without-expression
- shorthand-object-with-interpolated-strings
- shorthand-object-with-strings
- shorthand-object-with-this
- shorthand-this-member-expression-with-dot
- shorthand-this-member-expression
- shorthand-this
- simple-call
- simple-member-expression
- slice-with-lower-and-upper-bounds
- slice-with-no-bounds
- soaked-dynamic-member-access
- soaked-function-call
- soaked-member-access
- soaked-method-call
- soaked-new
- soaked-prototype-access
- soaked-slice
- soaked-splice
- splat-in-array-with-other-members
- splat-in-array
- splat-in-function-call-with-other-args
- splat-in-function-call
- splat-in-new-call
- string-ending-with-interpolation
- string-interpolation-in-object-literal
- string-interpolation-plus-normal-string
- string-interpolation-preceded-by-parenthesis
- string-interpolation-with-escaped-newline
- string-interpolation-with-plus
- string-starting-with-interpolation
- string-with-double-quotes
- string-with-interpolations-at-start-and-end
- string-with-interpolation
- string-with-noop-escape
- string-with-only-multiple-interpolations
- string-with-only-single-interpolation
- string-with-parentheses-inside
- string-with-single-quotes
- string-with-triple-double-quotes
- string-with-triple-quote-interpolation-containing-quotes
- string-with-triple-quote-interpolation
- string-with-triple-single-quotes
- subtraction
- switch-with-alternate
- switch-with-multiple-cases
- switch-with-multiple-conditions
- switch-with-one-case
- this-assign-with-keyword
- throw
- true
- try-with-catch-and-finally
- try-with-catch-assignee
- try-with-catch-single-line
- try-with-catch-without-assignee
- try-without-catch-or-finally
- try-without-catch-single-line
- try-without-catch-with-finally
- typeof
- unary-bitwise-negation
- unary-minus
- unary-plus
- undefined
- unless-in
- unless-not-instanceof
- unless-not-in
- until
- while-on-multiple-lines
- while-on-one-line
- while-with-guard
- yield-from
- yield-return-empty
- yield-return
- yield
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
275 files changed
+3652
-7447
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
316 | 314 | | |
317 | 315 | | |
318 | 316 | | |
319 | | - | |
| 317 | + | |
| 318 | + | |
320 | 319 | | |
321 | 320 | | |
322 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
14 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 7 | | |
| 8 | + | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 18 | | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 23 | | |
31 | 24 | | |
32 | 25 | | |
33 | 26 | | |
| 27 | + | |
34 | 28 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 29 | | |
| 30 | + | |
40 | 31 | | |
41 | 32 | | |
| 33 | + | |
42 | 34 | | |
43 | 35 | | |
44 | 36 | | |
45 | 37 | | |
46 | 38 | | |
47 | 39 | | |
| 40 | + | |
48 | 41 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 42 | | |
| 43 | + | |
54 | 44 | | |
55 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 7 | | |
| 8 | + | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 20 | | |
| 21 | + | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
| 27 | + | |
30 | 28 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 29 | | |
| 30 | + | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
40 | 35 | | |
| 36 | + | |
41 | 37 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 38 | | |
| 39 | + | |
47 | 40 | | |
48 | 41 | | |
49 | 42 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 43 | | |
| 44 | + | |
55 | 45 | | |
56 | 46 | | |
57 | 47 | | |
58 | 48 | | |
59 | 49 | | |
60 | 50 | | |
| 51 | + | |
61 | 52 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | 53 | | |
| 54 | + | |
67 | 55 | | |
68 | 56 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 7 | | |
| 8 | + | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 20 | | |
| 21 | + | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 25 | | |
| 26 | + | |
33 | 27 | | |
34 | 28 | | |
35 | 29 | | |
36 | 30 | | |
37 | 31 | | |
38 | 32 | | |
| 33 | + | |
39 | 34 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 35 | | |
| 36 | + | |
45 | 37 | | |
46 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 7 | | |
| 8 | + | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| 14 | + | |
16 | 15 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 16 | | |
| 17 | + | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| 21 | + | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
| 25 | + | |
28 | 26 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 27 | | |
| 28 | + | |
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 32 | | |
| 33 | + | |
42 | 34 | | |
43 | 35 | | |
44 | 36 | | |
45 | 37 | | |
46 | 38 | | |
47 | 39 | | |
| 40 | + | |
48 | 41 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 42 | | |
| 43 | + | |
54 | 44 | | |
55 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 7 | | |
| 8 | + | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| 13 | + | |
15 | 14 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 15 | | |
| 16 | + | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
| 23 | + | |
27 | 24 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 25 | | |
| 26 | + | |
33 | 27 | | |
34 | 28 | | |
0 commit comments