babel-runtime
Advanced tools
Comparing version 4.4.6 to 4.5.0
{ | ||
"name": "babel-runtime", | ||
"description": "babel selfContained runtime", | ||
"version": "4.4.6", | ||
"version": "4.5.0", | ||
"repository": "babel/babel", | ||
"author": "Sebastian McKenzie <sebmck@gmail.com>" | ||
} |
@@ -427,20 +427,23 @@ "use strict"; | ||
_findFinallyEntry: function _findFinallyEntry(finallyLoc) { | ||
abrupt: function abrupt(type, arg) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && (entry.finallyLoc === finallyLoc || this.prev < entry.finallyLoc)) { | ||
return entry; | ||
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { | ||
var finallyEntry = entry; | ||
break; | ||
} | ||
} | ||
}, | ||
abrupt: function abrupt(type, arg) { | ||
var entry = this._findFinallyEntry(); | ||
var record = entry ? entry.completion : {}; | ||
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg < finallyEntry.finallyLoc) { | ||
// Ignore the finally entry if control is not jumping to a | ||
// location outside the try/catch block. | ||
finallyEntry = null; | ||
} | ||
var record = finallyEntry ? finallyEntry.completion : {}; | ||
record.type = type; | ||
record.arg = arg; | ||
if (entry) { | ||
this.next = entry.finallyLoc; | ||
if (finallyEntry) { | ||
this.next = finallyEntry.finallyLoc; | ||
} else { | ||
@@ -471,4 +474,8 @@ this.complete(record); | ||
finish: function finish(finallyLoc) { | ||
var entry = this._findFinallyEntry(finallyLoc); | ||
return this.complete(entry.completion, entry.afterLoc); | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.finallyLoc === finallyLoc) { | ||
return this.complete(entry.completion, entry.afterLoc); | ||
} | ||
} | ||
}, | ||
@@ -475,0 +482,0 @@ |
105363
2878