Commit b09b2369 authored by Mathias Bynens's avatar Mathias Bynens Committed by Commit Bot

[test] Improve LineContinuation test coverage

The ECMAScript ⊃ JSON proposal doesn’t affect LineContinuation
grammar. These tests verify that the behavior remains the same when
the --harmony-subsume-json feature flag is enabled.

Bug: v8:7418
Change-Id: Iec5cb1bc112f278481ba1202f0c2b8693917843a
Reviewed-on: https://chromium-review.googlesource.com/1067463Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53270}
parent 7f67bea4
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-subsume-json
// https://tc39.github.io/ecma262/#sec-literals-string-literals
//
// LineContinuation ::
// \ LineTerminatorSequence
//
// LineTerminatorSequence ::
// <LF>
// <CR>[lookahead ≠ <LF>]
// <LS>
// <PS>
// <CR><LF>
// LineTerminatorSequence :: <LF>
assertEquals('', eval('"\\\n"'));
assertEquals('', eval("'\\\n'"));
assertEquals('', eval('`\\\n`'));
// LineTerminatorSequence :: <CR>[lookahead ≠ <LF>]
assertEquals('', eval('"\\\r"'));
assertEquals('', eval("'\\\r'"));
assertEquals('', eval('`\\\r`'));
// LineTerminatorSequence :: <LS>
assertEquals('', eval('"\\\u2028"'));
assertEquals('', eval("'\\\u2028'"));
assertEquals('', eval('`\\\u2028`'));
// LineTerminatorSequence :: <PS>
assertEquals('', eval('"\\\u2029"'));
assertEquals('', eval("'\\\u2029'"));
assertEquals('', eval('`\\\u2029`'));
// LineTerminatorSequence :: <CR><LF>
assertEquals('', eval('"\\\r\n"'));
assertEquals('', eval("'\\\r\n'"));
assertEquals('', eval('`\\\r\n`'));
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://tc39.github.io/ecma262/#sec-literals-string-literals
//
// LineContinuation ::
// \ LineTerminatorSequence
//
// LineTerminatorSequence ::
// <LF>
// <CR>[lookahead ≠ <LF>]
// <LS>
// <PS>
// <CR><LF>
// LineTerminatorSequence :: <LF>
assertEquals('', eval('"\\\n"'));
assertEquals('', eval("'\\\n'"));
assertEquals('', eval('`\\\n`'));
// LineTerminatorSequence :: <CR>[lookahead ≠ <LF>]
assertEquals('', eval('"\\\r"'));
assertEquals('', eval("'\\\r'"));
assertEquals('', eval('`\\\r`'));
// LineTerminatorSequence :: <LS>
assertEquals('', eval('"\\\u2028"'));
assertEquals('', eval("'\\\u2028'"));
assertEquals('', eval('`\\\u2028`'));
// LineTerminatorSequence :: <PS>
assertEquals('', eval('"\\\u2029"'));
assertEquals('', eval("'\\\u2029'"));
assertEquals('', eval('`\\\u2029`'));
// LineTerminatorSequence :: <CR><LF>
assertEquals('', eval('"\\\r\n"'));
assertEquals('', eval("'\\\r\n'"));
assertEquals('', eval('`\\\r\n`'));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment