Reland "Symbol.prototype.description"

This is a reland of 18d0d7f639
without any changes. This used to break the custom snapshot build but
the bug seems to be fixed elsewhere.

Original change's description:
> 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: Sathya Gunasekaran <gsathya@chromium.org>
> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53933}

Bug: v8:7807
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I1225b9c8619c1a628149c9b54058798aab93a2a8
Reviewed-on: https://chromium-review.googlesource.com/1131156
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54691}
This commit is contained in:
Joyee Cheung 2018-07-10 20:23:55 +08:00 committed by Commit Bot
parent 91a5c8baea
commit 038abad8ec
3 changed files with 21 additions and 13 deletions

View File

@ -230,19 +230,19 @@ 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) \
V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_import_meta, "harmony import.meta property") \
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}")
#define HARMONY_SHIPPING(V) \
V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_import_meta, "harmony import.meta property") \
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_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,

View File

@ -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;

View File

@ -30,6 +30,11 @@ expression: Object(Symbol(42))
description : Symbol
overflow : false
properties : [
[0] : {
name : description
type : string
value : 42
}
]
type : object
}