Skip to content

Commit

Permalink
[fix] fail to get cur scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Siubaak committed Feb 19, 2024
1 parent 4dd21fa commit bb180f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ export default class Scope {
}

static getSpecifiedScope(check) {
for (let i = Scope.chain.length - 1; i !== -1; i--) {
if (check(Scope.chain[i])) {
return Scope.chain[i];
const chain = Scope.chain;
const len = chain.length;
for (let i = len - 1; i !== -1; i--) {
if (check(chain[i])) {
return chain[i];
}
}
return chain[len - 1];
}

static getScopeByCallFrameId(callFrameId) {
Expand Down

0 comments on commit bb180f0

Please sign in to comment.