Add tests for `debugger` statement

The runtime semantics of this statement are host-defined and therefore
untestable, but the statement's affect on the formal grammar should be
consistent across all implementations.
This commit is contained in:
Mike Pennisi 2016-03-09 11:12:56 -05:00
parent 007d3b1eb7
commit 4f5a8674c2
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,10 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The `debugger` token may not occupy an expression position
esid: sec-debugger-statement
es6id: 13.16
negative: SyntaxError
---*/
(debugger);

View File

@ -0,0 +1,12 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The `debugger` token may occupy a statement position
esid: sec-debugger-statement
es6id: 13.16
---*/
// Expressing within a `while` statement ensures that the `debugger keyword is
// not erroneously interpreted as a declaration. It also avoids statement
// evaluation, which is host-defined an may interrupt test execution.
while (false) debugger;