Commit 18d0d7f6 authored by Joyee Cheung's avatar Joyee Cheung Committed by Commit Bot

Ship Symbol.prototype.description

Intent to ship:
https://groups.google.com/forum/#!msg/v8-users/9U2kEQw8pb8/Sn91yUx5BQAJ

Bug: v8:7807
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia9e73495b08b432371dfb0ccc571af969ae4d59f
Reviewed-on: https://chromium-review.googlesource.com/1107210
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53933}
parent 087aa1a5
......@@ -227,8 +227,7 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
V(harmony_public_fields, "harmony public fields in class literals") \
V(harmony_private_fields, "harmony private fields in class literals") \
V(harmony_numeric_separator, "harmony numeric separator between digits") \
V(harmony_string_matchall, "harmony String.prototype.matchAll") \
V(harmony_symbol_description, "harmony Symbol.prototype.description")
V(harmony_string_matchall, "harmony String.prototype.matchAll")
// Features that are shipping (turned on by default, but internal flag remains).
#define HARMONY_SHIPPING(V) \
......@@ -239,7 +238,8 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
V(harmony_bigint, "harmony arbitrary precision integers") \
V(harmony_dynamic_import, "harmony dynamic import") \
V(harmony_array_prototype_values, "harmony Array.prototype.values") \
V(harmony_array_flat, "harmony Array.prototype.{flat,flatMap}")
V(harmony_array_flat, "harmony Array.prototype.{flat,flatMap}") \
V(harmony_symbol_description, "harmony Symbol.prototype.description")
// Once a shipping feature has proved stable in the wild, it will be dropped
// from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed,
......
......@@ -401,9 +401,12 @@ InjectedScript.prototype = {
var isAccessorProperty = descriptor && ("get" in descriptor || "set" in descriptor);
if (accessorPropertiesOnly && !isAccessorProperty)
continue;
if (descriptor && "get" in descriptor && "set" in descriptor && name !== "__proto__" &&
// Special case for Symbol.prototype.description where the receiver of the getter is not an actual object.
// Should only occur for nested previews.
var isSymbolDescription = isSymbol(object) && name === 'description';
if (isSymbolDescription || (descriptor && "get" in descriptor && "set" in descriptor && name !== "__proto__" &&
InjectedScriptHost.formatAccessorsAsProperties(object, descriptor.get) &&
!doesAttributeHaveObservableSideEffectOnGet(object, name)) {
!doesAttributeHaveObservableSideEffectOnGet(object, name))) {
descriptor.value = object[property];
descriptor.isOwn = true;
delete descriptor.get;
......
......@@ -30,6 +30,11 @@ expression: Object(Symbol(42))
description : Symbol
overflow : false
properties : [
[0] : {
name : description
type : string
value : 42
}
]
type : object
}
......
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