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

port bc3b2960e3 (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}
This commit is contained in:
cdai2 2015-01-21 16:30:14 +08:00
parent 207eae6022
commit 3175d30249

View File

@ -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();
}
}