WebKit Bugzilla
Attachment 348965 Details for
Bug 186686
: [ESNext] Symbol.prototype.description
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-186686-20180905143949.patch (text/plain), 4.75 KB, created by
Ross Kirsling
on 2018-09-05 14:39:50 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Ross Kirsling
Created:
2018-09-05 14:39:50 PDT
Size:
4.75 KB
patch
obsolete
>Subversion Revision: 235621 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 7aeccbdf05352ed3c2156e31d4c0806cb1e6b2b1..120035977cfc504d9ccca999e382060574311f7a 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-09-05 Ross Kirsling <ross.kirsling@sony.com> >+ >+ [ESNext] Symbol.prototype.description >+ https://bugs.webkit.org/show_bug.cgi?id=186686 >+ >+ Reviewed by Keith Miller. >+ >+ Symbol.prototype.description was implemented in r232404, but has one small bug: >+ It should return undefined for a null symbol. >+ >+ * runtime/Symbol.cpp: >+ (JSC::Symbol::description const): >+ * runtime/SymbolPrototype.cpp: >+ (JSC::symbolProtoGetterDescription): >+ Address the null symbol case. >+ > 2018-09-04 Michael Catanzaro <mcatanzaro@igalia.com> > > [WPE][GTK] Add more unused result warnings to JSC API >diff --git a/Source/JavaScriptCore/runtime/Symbol.cpp b/Source/JavaScriptCore/runtime/Symbol.cpp >index 44b0dfacf497ed857450099eff17b79eb6d91fe2..d83e31d1029c3ea29931c1de23b00bc4ecf6c109 100644 >--- a/Source/JavaScriptCore/runtime/Symbol.cpp >+++ b/Source/JavaScriptCore/runtime/Symbol.cpp >@@ -105,7 +105,8 @@ String Symbol::descriptiveString() const > > String Symbol::description() const > { >- return privateName().uid(); >+ auto& uid = privateName().uid(); >+ return uid.isNullSymbol() ? String() : uid; > } > > Symbol* Symbol::create(VM& vm) >diff --git a/Source/JavaScriptCore/runtime/SymbolPrototype.cpp b/Source/JavaScriptCore/runtime/SymbolPrototype.cpp >index 458a6338ee9861bb8c3622b579a6b7d9abfff791..f4e9d1cb1d2076b81e670492f8f983ab3c0e0591 100644 >--- a/Source/JavaScriptCore/runtime/SymbolPrototype.cpp >+++ b/Source/JavaScriptCore/runtime/SymbolPrototype.cpp >@@ -97,7 +97,8 @@ EncodedJSValue JSC_HOST_CALL symbolProtoGetterDescription(ExecState* exec) > if (!symbol) > return throwVMTypeError(exec, scope, SymbolDescriptionTypeError); > scope.release(); >- return JSValue::encode(jsString(&vm, symbol->description())); >+ const auto description = symbol->description(); >+ return JSValue::encode(description.isNull() ? jsUndefined() : jsString(&vm, description)); > } > > EncodedJSValue JSC_HOST_CALL symbolProtoFuncToString(ExecState* exec) >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index 8e752363b996d7aa0235928132a6d2dd53db1680..e4481f545ca13a7797c40f7e0c75513d45d690d1 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-09-05 Ross Kirsling <ross.kirsling@sony.com> >+ >+ [ESNext] Symbol.prototype.description >+ https://bugs.webkit.org/show_bug.cgi?id=186686 >+ >+ Reviewed by Keith Miller. >+ >+ * stress/symbol-description.js: >+ Add tests for empty and null symbol cases. >+ >+ * test262/config.yaml: >+ Enable Symbol.prototype.description tests. >+ > 2018-09-03 Mark Lam <mark.lam@apple.com> > > The watchdog sometimes fails to terminate a script. >diff --git a/JSTests/stress/symbol-description.js b/JSTests/stress/symbol-description.js >index 27e39797c11c0787110bf6b6f22e123e86d94b2f..f2d8c760f08d11ec5d5eb4979878074e37a43c1c 100644 >--- a/JSTests/stress/symbol-description.js >+++ b/JSTests/stress/symbol-description.js >@@ -20,19 +20,31 @@ function shouldThrow(func, errorMessage) { > > var s0 = Symbol("Cocoa"); > var s1 = Symbol("Cappuccino"); >+var s2 = Symbol(""); >+var s3 = Symbol(); > > shouldBe(s0.description, "Cocoa"); > shouldBe(s0.toString(), "Symbol(Cocoa)"); > shouldBe(s1.description, "Cappuccino"); > shouldBe(s1.toString(), "Symbol(Cappuccino)"); >+shouldBe(s2.description, ""); >+shouldBe(s2.toString(), "Symbol()"); >+shouldBe(s3.description, undefined); >+shouldBe(s3.toString(), "Symbol()"); > > var o0 = Object(s0); > var o1 = Object(s1); >+var o2 = Object(s2); >+var o3 = Object(s3); > > shouldBe(o0.description, "Cocoa"); > shouldBe(o0.toString(), "Symbol(Cocoa)"); > shouldBe(o1.description, "Cappuccino"); > shouldBe(o1.toString(), "Symbol(Cappuccino)"); >+shouldBe(o2.description, ""); >+shouldBe(o2.toString(), "Symbol()"); >+shouldBe(o3.description, undefined); >+shouldBe(o3.toString(), "Symbol()"); > > var descriptor = Object.getOwnPropertyDescriptor(Symbol.prototype, "description"); > shouldBe(descriptor.enumerable, false); >diff --git a/JSTests/test262/config.yaml b/JSTests/test262/config.yaml >index 2d2716c9efcd0968577a74a776ca78ae442085e4..b14a9a9b65b625262a3c05eaf6a6d3c356206a9f 100644 >--- a/JSTests/test262/config.yaml >+++ b/JSTests/test262/config.yaml >@@ -11,8 +11,6 @@ skip: > - BigInt > # https://bugs.webkit.org/show_bug.cgi?id=166693 > - async-iteration >- # https://bugs.webkit.org/show_bug.cgi?id=186686 >- - Symbol.prototype.description > # https://bugs.webkit.org/show_bug.cgi?id=186694 > - String.prototype.matchAll > - Symbol.matchAll
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186686
:
348962
| 348965