d683fd7dd6
When parsing a numeric literal in a line like "a=0x0e+b|0;", currently the scanner consumes the "e+" part (as it thinks it's the start of an exponent). In the ECMAScript lexical grammar HexIntegerLiteral cannot contain exponents, which means the '+' character should be parsed as a binary operator. R=bradnelson@chromium.org BUG=v8:7893 Change-Id: I97a0d4ea2ee1d38a3462efbfaef5eb87b8ea704b Reviewed-on: https://chromium-review.googlesource.com/1116551 Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#54132}
19 lines
459 B
JavaScript
19 lines
459 B
JavaScript
// 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: --validate-asm --allow-natives-syntax
|
|
|
|
function Module(stdlib, imports, buffer) {
|
|
"use asm";
|
|
function f() {
|
|
var bar = 0;
|
|
return 0x1e+bar|0;
|
|
}
|
|
return f;
|
|
}
|
|
var f = Module(this);
|
|
assertTrue(%IsWasmCode(f));
|
|
assertTrue(%IsAsmWasmCode(Module));
|
|
assertEquals(0x1e, f());
|