Commit 3175d302 authored by cdai2's avatar cdai2

X87: Fix issue with __proto__ when using ES6 object literals.

port bc3b2960 (r26172).

original commit message:
  Fix issue with __proto__ when using ES6 object literals

  It should be possible to create a concise method with the name
  __proto__ without setting the [[Prototype]]. Similarly, property
  name shorthands with the name __proto__ should define an own
  property.

BUG=
R=weiliang.lin@intel.com

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

Cr-Commit-Position: refs/heads/master@{#26179}
parent 207eae60
......@@ -2456,8 +2456,9 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
switch (property->kind()) {
case ObjectLiteral::Property::CONSTANT:
case ObjectLiteral::Property::MATERIALIZED_LITERAL:
case ObjectLiteral::Property::COMPUTED:
case ObjectLiteral::Property::PROTOTYPE:
UNREACHABLE();
case ObjectLiteral::Property::COMPUTED:
__ CallRuntime(Runtime::kDefineClassMethod, 3);
break;
......@@ -2468,9 +2469,6 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
case ObjectLiteral::Property::SETTER:
__ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 3);
break;
default:
UNREACHABLE();
}
}
......
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