Commit c4247c1b authored by adamk's avatar adamk Committed by Commit bot

[es6] new.target should not be shadowable in a with scope

BUG=v8:3887
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#30010}
parent c9fcaeb3
......@@ -267,7 +267,7 @@ class AstValue : public ZoneObject {
F(make_syntax_error, "MakeSyntaxError") \
F(make_type_error, "MakeTypeError") \
F(native, "native") \
F(new_target, "new.target") \
F(new_target, ".new.target") \
F(next, "next") \
F(proto, "__proto__") \
F(prototype, "prototype") \
......
......@@ -2827,7 +2827,7 @@ class SuperCallReference final : public Expression {
new_target_var_(new_target_var),
this_function_var_(this_function_var) {
DCHECK(this_var->is_this());
DCHECK(new_target_var->raw_name()->IsOneByteEqualTo("new.target"));
DCHECK(new_target_var->raw_name()->IsOneByteEqualTo(".new.target"));
DCHECK(this_function_var->raw_name()->IsOneByteEqualTo(".this_function"));
}
......
......@@ -381,4 +381,6 @@
assertSame(f4, new f4);
function f5() { 'use strict'; { let x; return new.target } }
assertSame(f5, new f5);
function f6() { with ({'new.target': 42}) return new.target }
assertSame(f6, new f6);
})();
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