File tree 1 file changed +8
-11
lines changed
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -116,16 +116,6 @@ module.exports = {
116
116
* @type {ScopeStack | null }
117
117
*/
118
118
let scopeStack = null
119
- /**
120
- * @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression } node
121
- */
122
- function onFunctionEnter ( node ) {
123
- scopeStack = {
124
- upper : scopeStack ,
125
- body : node . body ,
126
- returnTypes : null
127
- }
128
- }
129
119
130
120
function onFunctionExit ( ) {
131
121
scopeStack = scopeStack && scopeStack . upper
@@ -300,7 +290,11 @@ module.exports = {
300
290
* @param {VueObjectData } data
301
291
*/
302
292
':function' ( node , { node : vueNode } ) {
303
- onFunctionEnter ( node )
293
+ scopeStack = {
294
+ upper : scopeStack ,
295
+ body : node . body ,
296
+ returnTypes : null
297
+ }
304
298
305
299
const data = vueObjectPropsContexts . get ( vueNode )
306
300
if ( ! data ) {
@@ -317,6 +311,9 @@ module.exports = {
317
311
* @param {ReturnStatement } node
318
312
*/
319
313
ReturnStatement ( node ) {
314
+ if ( ! scopeStack ) {
315
+ return
316
+ }
320
317
if ( scopeStack . returnTypes && node . argument ) {
321
318
const type = getValueType ( node . argument )
322
319
if ( type ) {
You can’t perform that action at this time.
0 commit comments