This repository was archived by the owner on Aug 18, 2021. It is now read-only.
File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ function monkeypatch(modules) {
62
62
63
63
var analyze = escope . analyze ;
64
64
escope . analyze = function ( ast , opts ) {
65
+ opts = opts || { } ;
65
66
opts . ecmaVersion = eslintOptions . ecmaVersion ;
66
67
opts . sourceType = eslintOptions . sourceType ;
67
68
if ( eslintOptions . globalReturn !== undefined ) {
Original file line number Diff line number Diff line change 1
1
var assert = require ( "assert" ) ;
2
2
var babelEslint = require ( ".." ) ;
3
3
var espree = require ( "espree" ) ;
4
+ var escope = require ( "escope" ) ;
4
5
var util = require ( "util" ) ;
5
6
var unpad = require ( "dedent" ) ;
6
7
@@ -85,6 +86,16 @@ function parseAndAssertSame(code) {
85
86
}
86
87
87
88
describe ( "babylon-to-esprima" , ( ) => {
89
+ describe ( "compatibility" , ( ) => {
90
+ it ( "should allow ast.analyze to be called without options" , function ( ) {
91
+ var esAST = babelEslint . parse ( "`test`" ) ;
92
+
93
+ assert . doesNotThrow ( ( ) => {
94
+ escope . analyze ( esAST ) ;
95
+ } , TypeError , "Should allow no options argument." ) ;
96
+ } ) ;
97
+ } ) ;
98
+
88
99
describe ( "templates" , ( ) => {
89
100
it ( "empty template string" , ( ) => {
90
101
parseAndAssertSame ( "``" ) ;
You can’t perform that action at this time.
0 commit comments