From 24e1bcbfeaa5f71e678841d2e247300b95e67d47 Mon Sep 17 00:00:00 2001 From: conradw Date: Wed, 5 Aug 2015 08:36:56 -0700 Subject: [PATCH] [strong] dot prototypes of strong class literals should be strong objects BUG=v8:3956 LOG=N Review URL: https://codereview.chromium.org/1270423003 Cr-Commit-Position: refs/heads/master@{#30032} --- src/runtime/runtime-classes.cc | 3 +++ test/mjsunit/strong/literals.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc index 76c5c00..8312090 100644 --- a/src/runtime/runtime-classes.cc +++ b/src/runtime/runtime-classes.cc @@ -137,6 +137,9 @@ static MaybeHandle DefineClass(Isolate* isolate, Handle name, Handle map = isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); + if (constructor->map()->is_strong()) { + map->set_is_strong(); + } Map::SetPrototype(map, prototype_parent); map->SetConstructor(*constructor); Handle prototype = isolate->factory()->NewJSObjectFromMap(map); diff --git a/test/mjsunit/strong/literals.js b/test/mjsunit/strong/literals.js index 73129e7..8c04d6e 100644 --- a/test/mjsunit/strong/literals.js +++ b/test/mjsunit/strong/literals.js @@ -310,8 +310,8 @@ let GeneratorPrototype = (function*(){}).__proto__; 'use strong'; function assertStrongClass(x) { assertTrue(%IsStrong(x)); - // TODO(rossberg): strongify class prototype and instance - // assertTrue(%IsStrong(x.prototype)); + assertTrue(%IsStrong(x.prototype)); + // TODO(rossberg): strongify class instance // assertTrue(%IsStrong(new x)); } class C {}; -- 2.7.4