@@ -53,6 +53,35 @@ var acceptsLeadingComments = (function() {
53
53
54
54
return accepts ;
55
55
} ) ( ) ;
56
+ var espreeOpts = {
57
+ comment : true ,
58
+ loc : true ,
59
+ range : true ,
60
+ tokens : true ,
61
+ ecmaFeatures : {
62
+ arrowFunctions : true ,
63
+ binaryLiterals : true ,
64
+ blockBindings : true ,
65
+ defaultParams : true ,
66
+ destructuring : true ,
67
+ forOf : true ,
68
+ generators : true ,
69
+ globalReturn : true ,
70
+ jsx : false ,
71
+ objectLiteralComputedProperties : true ,
72
+ objectLiteralDuplicateProperties : true ,
73
+ objectLiteralShorthandMethods : true ,
74
+ objectLiteralShorthandProperties : true ,
75
+ octalLiterals : true ,
76
+ regexUFlag : true ,
77
+ regexYFlag : true ,
78
+ restParams : true ,
79
+ spread : true ,
80
+ superInFunctions : true ,
81
+ templateStrings : true ,
82
+ unicodeCodePointEscapes : true
83
+ }
84
+ } ;
56
85
57
86
// TODO: docs
58
87
function canAcceptComment ( node ) {
@@ -119,7 +148,7 @@ function scrubComments(comments) {
119
148
// TODO: docs
120
149
var AstBuilder = exports . AstBuilder = function ( ) { } ;
121
150
122
- function parse ( source , filename , espreeOpts ) {
151
+ function parse ( source , filename ) {
123
152
var ast ;
124
153
125
154
try {
@@ -134,33 +163,7 @@ function parse(source, filename, espreeOpts) {
134
163
135
164
// TODO: docs
136
165
AstBuilder . prototype . build = function ( source , filename ) {
137
- var ast ;
138
-
139
- var espreeOpts = {
140
- comment : true ,
141
- loc : true ,
142
- range : true ,
143
- tokens : true ,
144
- ecmaFeatures : {
145
- binaryLiterals : true ,
146
- blockBindings : true ,
147
- defaultParams : true ,
148
- forOf : true ,
149
- generators : true ,
150
- jsx : false ,
151
- objectLiteralComputedProperties : true ,
152
- objectLiteralDuplicateProperties : true ,
153
- objectLiteralShorthandMethods : true ,
154
- objectLiteralShorthandProperties : true ,
155
- octalLiterals : true ,
156
- regexUFlag : true ,
157
- regexYFlag : true ,
158
- templateStrings : true ,
159
- unicodeCodePointEscapes : true
160
- }
161
- } ;
162
-
163
- ast = parse ( source , filename , espreeOpts ) ;
166
+ var ast = parse ( source , filename ) ;
164
167
165
168
if ( ast ) {
166
169
this . _postProcess ( filename , ast ) ;
0 commit comments