Stop treating `debugger` statements as jumps

Since in most debuggers you can continue past them.

No tests added, since I wasn't sure how to test code with `debugger`
in it.
This commit is contained in:
Marijn Haverbeke 2011-11-24 11:43:33 +01:00
parent 7d22a011ab
commit 24836ccf6d
2 changed files with 4 additions and 6 deletions

View File

@ -390,12 +390,10 @@
};
Literal.prototype.jumps = function(o) {
if (!this.isStatement()) return false;
if (!(o && (o.loop || o.block && (this.value !== 'continue')))) {
if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) {
return this;
} else {
return false;
}
if (this.value === 'continue' && !(o != null ? o.loop : void 0)) return this;
};
Literal.prototype.compileNode = function(o) {

View File

@ -309,8 +309,8 @@ exports.Literal = class Literal extends Base
name is @value
jumps: (o) ->
return no unless @isStatement()
if not (o and (o.loop or o.block and (@value isnt 'continue'))) then this else no
return this if @value is 'break' and not (o?.loop or o?.block)
return this if @value is 'continue' and not o?.loop
compileNode: (o) ->
code = if @isUndefined