Commit fd5a0de2 authored by Erik Arvidsson's avatar Erik Arvidsson

Fix location of super syntax errors

BUG=v8:3885
LOG=N
R=adamk@chromium.org, dslomov@chromium.org

Review URL: https://codereview.chromium.org/916293004

Cr-Commit-Position: refs/heads/master@{#26632}
parent 7866f005
......@@ -2736,7 +2736,6 @@ ParserBase<Traits>::ParseMemberExpression(bool* ok) {
template <class Traits>
typename ParserBase<Traits>::ExpressionT
ParserBase<Traits>::ParseSuperExpression(bool is_new, bool* ok) {
int beg_pos = position();
Expect(Token::SUPER, CHECK_OK);
FunctionState* function_state = function_state_;
......@@ -2760,7 +2759,7 @@ ParserBase<Traits>::ParseSuperExpression(bool is_new, bool* ok) {
}
}
ReportMessageAt(Scanner::Location(beg_pos, position()), "unexpected_super");
ReportMessageAt(scanner()->location(), "unexpected_super");
*ok = false;
return this->EmptyExpression();
}
......
// Copyright 2015 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-classes
'use strict';
function f() {
super.x();
}
# Copyright 2014 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.
*%(basename)s:9: SyntaxError: 'super' keyword unexpected here
super.x();
^^^^^
SyntaxError: 'super' keyword unexpected here
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