From 3175d302495ede827e2912656c791acf1440e669 Mon Sep 17 00:00:00 2001 From: cdai2 Date: Wed, 21 Jan 2015 16:30:14 +0800 Subject: [PATCH] X87: Fix issue with __proto__ when using ES6 object literals. port bc3b2960e3b7abc16440717f289a430aef904cb1 (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} --- src/x87/full-codegen-x87.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc index 6bca8a0cee..33ae5a1c53 100644 --- a/src/x87/full-codegen-x87.cc +++ b/src/x87/full-codegen-x87.cc @@ -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(); } }