Title: [248898] trunk
Revision
248898
Author
[email protected]
Date
2019-08-20 03:41:33 -0700 (Tue, 20 Aug 2019)

Log Message

Web Inspector: Support for _javascript_ BigInt
https://bugs.webkit.org/show_bug.cgi?id=180731
<rdar://problem/36298748>

Source/_javascript_Core:

Reviewed by Devin Rousso.

* inspector/InjectedScriptSource.js:
(toStringDescription):
(isSymbol):
(isBigInt):
(let.InjectedScript.prototype._fallbackWrapper):
(let.RemoteObject):
(let.RemoteObject.subtype):
(let.RemoteObject.describe):
(let.RemoteObject.prototype._appendPropertyPreviews):
(let.RemoteObject.set _isPreviewableObjectInternal):
(let.RemoteObject.prototype._isPreviewableObject.set add):
* inspector/protocol/Runtime.json:
New RemoteObject type and preview support.

* runtime/RuntimeType.cpp:
(JSC::runtimeTypeForValue):
(JSC::runtimeTypeAsString):
* runtime/RuntimeType.h:
* runtime/TypeSet.cpp:
(JSC::TypeSet::displayName const):
(JSC::TypeSet::inspectorTypeSet const):
New type for the type profiler.

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::json):
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::getPreview):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::toString):
(JSC::JSBigInt::tryGetString):
(JSC::JSBigInt::toStringBasePowerOfTwo):
(JSC::JSBigInt::toStringGeneric):
* runtime/JSBigInt.h:
BigInts are not tied to a GlobalObject, so provide a way to get a
String for HeapSnapshot previews that are not tied to an ExecState.

Source/WebInspectorUI:

Reviewed by Devin Rousso.

* UserInterface/External/CodeMirror/_javascript_.js:
(expressionAllowed):
Cherry-pick BigInt _javascript_ mode support from CodeMirror:
https://github.com/codemirror/CodeMirror/pull/5411

* UserInterface/Images/TypeBigInt.svg: Added.
* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
(.cm-s-default .cm-number.cm-bigint,):
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property.bigint > .icon):
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot .icon.bigint):
Style BigInt similiar but different from numbers but with
a [B] icon instead of [N].

* UserInterface/Views/FormattedValue.css:
(.formatted-bigint):
* UserInterface/Views/FormattedValue.js:
(WI.FormattedValue.hasSimpleDisplay):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
Simple value formatting for the new type.

* UserInterface/Models/TypeSet.js:
(WI.TypeSet):
(WI.TypeSet.prototype.get primitiveTypeNames):
* UserInterface/Views/TypeTokenView.css:
(.type-token-bigint):
* UserInterface/Views/TypeTokenView.js:
(WI.TypeTokenView.prototype._displayTypeName):
(WI.TypeTokenView):
New type handling for the Type profiler.

* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject):
(WI.RemoteObject.createBigIntFromDescriptionString):
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WI.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
BigInt values are not tied to a GlobalObject, so do some special casing
in the Heap output (like Strings) so we get a preview.

Source/WebKit:

Reviewed by Devin Rousso.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::WebInspectorUI):
Enable BigInt in the Web Inspector process. It only makes use of
`globalThis.BigInt(...)` to hold the value.

LayoutTests:

Reviewed by Devin Rousso.

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
* inspector/model/resources/remote-object-utilities.js:
Include simple tests for a BigInt value and preview.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (248897 => 248898)


--- trunk/LayoutTests/ChangeLog	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/LayoutTests/ChangeLog	2019-08-20 10:41:33 UTC (rev 248898)
@@ -1,3 +1,16 @@
+2019-08-20  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Support for _javascript_ BigInt
+        https://bugs.webkit.org/show_bug.cgi?id=180731
+        <rdar://problem/36298748>
+
+        Reviewed by Devin Rousso.
+
+        * inspector/model/remote-object-expected.txt:
+        * inspector/model/remote-object.html:
+        * inspector/model/resources/remote-object-utilities.js:
+        Include simple tests for a BigInt value and preview.
+
 2019-08-20  Devin Rousso  <[email protected]>
 
         Web Inspector: Use URL constructor to better handle all kinds of URLs

Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (248897 => 248898)


--- trunk/LayoutTests/inspector/model/remote-object-expected.txt	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt	2019-08-20 10:41:33 UTC (rev 248898)
@@ -146,6 +146,14 @@
 }
 
 -----------------------------------------------------
+_expression_: 123n
+{
+  "_type": "bigint",
+  "_description": "123n",
+  "_value": "<filtered 123n>"
+}
+
+-----------------------------------------------------
 _expression_: ''
 {
   "_type": "string",
@@ -1296,7 +1304,7 @@
 }
 
 -----------------------------------------------------
-_expression_: ({a: 1, b: 0, c: -0})
+_expression_: ({a: 1, b: 0, c: -0, d: 456n})
 {
   "_type": "object",
   "_objectId": "<filtered>",
@@ -1321,6 +1329,11 @@
         "_name": "c",
         "_type": "number",
         "_value": "-0"
+      },
+      {
+        "_name": "d",
+        "_type": "bigint",
+        "_value": "456n"
       }
     ],
     "_entries": null

Modified: trunk/LayoutTests/inspector/model/remote-object.html (248897 => 248898)


--- trunk/LayoutTests/inspector/model/remote-object.html	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/LayoutTests/inspector/model/remote-object.html	2019-08-20 10:41:33 UTC (rev 248898)
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html><!-- webkit-test-runner [ jscOptions=--useBigInt=true ] -->
 <html>
 <head>
 <meta charset="utf-8">
@@ -38,6 +38,9 @@
         {_expression_: `Infinity`},
         {_expression_: `-Infinity`},
 
+        // BigInt
+        {_expression_: `123n`},
+
         // Strings
         {_expression_: `''`},
         {_expression_: `'"'`}, // a single quoted string
@@ -95,7 +98,7 @@
         // Object
         {_expression_: `({})`},
         {_expression_: `({a: 1})`},
-        {_expression_: `({a: 1, b: 0, c: -0})`},
+        {_expression_: `({a: 1, b: 0, c: -0, d: 456n})`},
         {_expression_: `({a: 1, b: \"string\", c: /regex/, d: Symbol("sym")})`},
         {_expression_: `o = {a:1}; o.b = o; o`}, // cyclic
         {_expression_: `({a:function a(){}, b:function b(){}, get getter(){}, set setter(v){}})`},

Modified: trunk/LayoutTests/inspector/model/resources/remote-object-utilities.js (248897 => 248898)


--- trunk/LayoutTests/inspector/model/resources/remote-object-utilities.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/LayoutTests/inspector/model/resources/remote-object-utilities.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -20,6 +20,8 @@
             return undefined;
         if (key === "_objectId" || key === "_stackTrace")
             return "<filtered>";
+        if (typeof value === "bigint")
+            return "<filtered " + String(value) + "n>";
         return value;
     }
 

Modified: trunk/Source/_javascript_Core/ChangeLog (248897 => 248898)


--- trunk/Source/_javascript_Core/ChangeLog	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-08-20 10:41:33 UTC (rev 248898)
@@ -1,3 +1,47 @@
+2019-08-20  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Support for _javascript_ BigInt
+        https://bugs.webkit.org/show_bug.cgi?id=180731
+        <rdar://problem/36298748>
+
+        Reviewed by Devin Rousso.        
+        
+        * inspector/InjectedScriptSource.js:
+        (toStringDescription):
+        (isSymbol):
+        (isBigInt):
+        (let.InjectedScript.prototype._fallbackWrapper):
+        (let.RemoteObject):
+        (let.RemoteObject.subtype):
+        (let.RemoteObject.describe):
+        (let.RemoteObject.prototype._appendPropertyPreviews):
+        (let.RemoteObject.set _isPreviewableObjectInternal):
+        (let.RemoteObject.prototype._isPreviewableObject.set add):
+        * inspector/protocol/Runtime.json:
+        New RemoteObject type and preview support.
+
+        * runtime/RuntimeType.cpp:
+        (JSC::runtimeTypeForValue):
+        (JSC::runtimeTypeAsString):
+        * runtime/RuntimeType.h:
+        * runtime/TypeSet.cpp:
+        (JSC::TypeSet::displayName const):
+        (JSC::TypeSet::inspectorTypeSet const):
+        New type for the type profiler.
+
+        * heap/HeapSnapshotBuilder.cpp:
+        (JSC::HeapSnapshotBuilder::json):
+        * inspector/agents/InspectorHeapAgent.cpp:
+        (Inspector::InspectorHeapAgent::getPreview):
+        * runtime/JSBigInt.cpp:
+        (JSC::JSBigInt::toString):
+        (JSC::JSBigInt::tryGetString):
+        (JSC::JSBigInt::toStringBasePowerOfTwo):
+        (JSC::JSBigInt::toStringGeneric):
+        * runtime/JSBigInt.h:
+        BigInts are not tied to a GlobalObject, so provide a way to get a
+        String for HeapSnapshot previews that are not tied to an ExecState.
+
 2019-08-19  Devin Rousso  <[email protected]>
 
         Web Inspector: Debugger: add a global breakpoint for pausing in the next microtask

Modified: trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp (248897 => 248898)


--- trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp	2019-08-20 10:41:33 UTC (rev 248898)
@@ -412,7 +412,7 @@
 
         void* wrappedAddress = 0;
         unsigned labelIndex = 0;
-        if (!node.cell->isString()) {
+        if (!node.cell->isString() && !node.cell->isBigInt()) {
             Structure* structure = node.cell->structure(vm);
             if (!structure || !structure->globalObject())
                 flags |= static_cast<unsigned>(NodeFlags::Internal);

Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js (248897 => 248898)


--- trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -45,6 +45,9 @@
     if (obj === 0 && 1 / obj < 0)
         return "-0";
 
+    if (isBigInt(obj))
+        return toString(obj) + "n";
+
     return toString(obj);
 }
 
@@ -55,11 +58,16 @@
     return "" + (obj >>> 0) === obj;
 }
 
-function isSymbol(obj)
+function isSymbol(value)
 {
-    return typeof obj === "symbol";
+    return typeof value === "symbol";
 }
 
+function isBigInt(value)
+{
+    return typeof value === "bigint";
+}
+
 function isEmptyObject(object)
 {
     for (let key in object)
@@ -484,7 +492,7 @@
         if (isPrimitiveValue(object))
             result.value = object;
         else
-            result.description = toString(object);
+            result.description = toStringDescription(object);
         return result;
     }
 
@@ -887,9 +895,10 @@
         if (this.type === "undefined" && InjectedScriptHost.isHTMLAllCollection(object))
             this.type = "object";
 
-        if (isPrimitiveValue(object) || object === null || forceValueType) {
+        if (isPrimitiveValue(object) || isBigInt(object) || object === null || forceValueType) {
             // We don't send undefined values over JSON.
-            if (this.type !== "undefined")
+            // BigInt values are not JSON serializable.
+            if (this.type !== "undefined" && this.type !== "bigint")
                 this.value = object;
 
             // Null object is object with 'null' subtype.
@@ -897,8 +906,9 @@
                 this.subtype = "null";
 
             // Provide user-friendly number values.
-            if (this.type === "number")
+            if (this.type === "number" || this.type === "bigint")
                 this.description = toStringDescription(object);
+
             return;
         }
 
@@ -966,7 +976,7 @@
         if (value === null)
             return "null";
 
-        if (isPrimitiveValue(value) || isSymbol(value))
+        if (isPrimitiveValue(value) || isBigInt(value) || isSymbol(value))
             return null;
 
         if (InjectedScriptHost.isHTMLAllCollection(value))
@@ -990,6 +1000,9 @@
         if (isPrimitiveValue(value))
             return null;
 
+        if (isBigInt(value))
+            return null;
+
         if (isSymbol(value))
             return toString(value);
 
@@ -1208,7 +1221,7 @@
 
             // Primitive.
             const maxLength = 100;
-            if (isPrimitiveValue(value)) {
+            if (isPrimitiveValue(value) || isBigInt(value)) {
                 if (type === "string" && value.length > maxLength) {
                     value = this._abbreviateString(value, maxLength, true);
                     preview.lossless = false;
@@ -1326,7 +1339,7 @@
             return false;
 
         // Primitive.
-        if (isPrimitiveValue(object) || isSymbol(object))
+        if (isPrimitiveValue(object) || isBigInt(object) || isSymbol(object))
             return true;
 
         // Null.

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorHeapAgent.cpp (248897 => 248898)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorHeapAgent.cpp	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorHeapAgent.cpp	2019-08-20 10:41:33 UTC (rev 248898)
@@ -31,6 +31,7 @@
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
 #include "InspectorEnvironment.h"
+#include "JSBigInt.h"
 #include "JSCInlines.h"
 #include "VM.h"
 #include <wtf/Stopwatch.h>
@@ -183,6 +184,12 @@
         return;
     }
 
+    // BigInt preview.
+    if (cell->isBigInt()) {
+        resultString = JSBigInt::tryGetString(vm, asBigInt(cell), 10);
+        return;
+    }
+
     // FIXME: Provide preview information for Internal Objects? CodeBlock, Executable, etc.
 
     Structure* structure = cell->structure(vm);

Modified: trunk/Source/_javascript_Core/inspector/protocol/Runtime.json (248897 => 248898)


--- trunk/Source/_javascript_Core/inspector/protocol/Runtime.json	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/inspector/protocol/Runtime.json	2019-08-20 10:41:33 UTC (rev 248898)
@@ -12,7 +12,7 @@
             "type": "object",
             "description": "Mirror object referencing original _javascript_ object.",
             "properties": [
-                { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
+                { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "bigint"], "description": "Object type." },
                 { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap", "weakset", "iterator", "class", "proxy"], "description": "Object subtype hint. Specified for <code>object</code> <code>function</code> (for class) type values only." },
                 { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
                 { "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values or JSON values if it was requested)." },
@@ -28,7 +28,7 @@
             "type": "object",
             "description": "Object containing abbreviated remote object value.",
             "properties": [
-                { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
+                { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "bigint"], "description": "Object type." },
                 { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap", "weakset", "iterator", "class", "proxy"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
                 { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
                 { "name": "lossless", "type": "boolean", "description": "Determines whether preview is lossless (contains all information of the original object)." },
@@ -43,7 +43,7 @@
             "type": "object",
             "properties": [
                 { "name": "name", "type": "string", "description": "Property name." },
-                { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "accessor"], "description": "Object type." },
+                { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "bigint", "accessor"], "description": "Object type." },
                 { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "error", "map", "set", "weakmap", "weakset", "iterator", "class", "proxy"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
                 { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },
                 { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." },
@@ -156,7 +156,8 @@
                 { "name": "isNumber", "type": "boolean", "description": "Indicates if this type description has been type Number." },
                 { "name": "isString", "type": "boolean", "description": "Indicates if this type description has been type String." },
                 { "name": "isObject", "type": "boolean", "description": "Indicates if this type description has been type Object." },
-                { "name": "isSymbol", "type": "boolean", "description": "Indicates if this type description has been type Symbol." }
+                { "name": "isSymbol", "type": "boolean", "description": "Indicates if this type description has been type Symbol." },
+                { "name": "isBigInt", "type": "boolean", "description": "Indicates if this type description has been type BigInt." }
             ]
         },
         {

Modified: trunk/Source/_javascript_Core/runtime/JSBigInt.cpp (248897 => 248898)


--- trunk/Source/_javascript_Core/runtime/JSBigInt.cpp	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/runtime/JSBigInt.cpp	2019-08-20 10:41:33 UTC (rev 248898)
@@ -59,8 +59,7 @@
 
 namespace JSC {
 
-const ClassInfo JSBigInt::s_info =
-    { "JSBigInt", nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSBigInt) };
+const ClassInfo JSBigInt::s_info = { "BigInt", nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSBigInt) };
 
 JSBigInt::JSBigInt(VM& vm, Structure* structure, unsigned length)
     : Base(vm, structure)
@@ -226,11 +225,22 @@
         return exec->vm().smallStrings.singleCharacterStringRep('0');
 
     if (hasOneBitSet(radix))
-        return toStringBasePowerOfTwo(exec, this, radix);
+        return toStringBasePowerOfTwo(exec->vm(), exec, this, radix);
 
-    return toStringGeneric(exec, this, radix);
+    return toStringGeneric(exec->vm(), exec, this, radix);
 }
 
+String JSBigInt::tryGetString(VM& vm, JSBigInt* bigInt, unsigned radix)
+{
+    if (bigInt->isZero())
+        return vm.smallStrings.singleCharacterStringRep('0');
+
+    if (hasOneBitSet(radix))
+        return toStringBasePowerOfTwo(vm, nullptr, bigInt, radix);
+
+    return toStringGeneric(vm, nullptr, bigInt, radix);
+}
+
 // Multiplies {this} with {factor} and adds {summand} to the result.
 void JSBigInt::inplaceMultiplyAdd(Digit factor, Digit summand)
 {
@@ -1554,12 +1564,11 @@
     return maximumCharactersRequired;
 }
 
-String JSBigInt::toStringBasePowerOfTwo(ExecState* exec, JSBigInt* x, unsigned radix)
+String JSBigInt::toStringBasePowerOfTwo(VM& vm, ExecState* exec, JSBigInt* x, unsigned radix)
 {
     ASSERT(hasOneBitSet(radix));
     ASSERT(radix >= 2 && radix <= 32);
     ASSERT(!x->isZero());
-    VM& vm = exec->vm();
 
     const unsigned length = x->length();
     const bool sign = x->sign();
@@ -1575,8 +1584,10 @@
     const size_t charsRequired = (bitLength + bitsPerChar - 1) / bitsPerChar + sign;
 
     if (charsRequired > JSString::MaxLength) {
-        auto scope = DECLARE_THROW_SCOPE(vm);
-        throwOutOfMemoryError(exec, scope);
+        if (exec) {
+            auto scope = DECLARE_THROW_SCOPE(vm);
+            throwOutOfMemoryError(exec, scope);            
+        }
         return String();
     }
 
@@ -1615,14 +1626,12 @@
     return StringImpl::adopt(WTFMove(resultString));
 }
 
-String JSBigInt::toStringGeneric(ExecState* exec, JSBigInt* x, unsigned radix)
+String JSBigInt::toStringGeneric(VM& vm, ExecState* exec, JSBigInt* x, unsigned radix)
 {
     // FIXME: [JSC] Revisit usage of Vector into JSBigInt::toString
     // https://bugs.webkit.org/show_bug.cgi?id=18067
     Vector<LChar> resultString;
 
-    VM& vm = exec->vm();
-
     ASSERT(radix >= 2 && radix <= 36);
     ASSERT(!x->isZero());
 
@@ -1633,8 +1642,10 @@
     uint64_t maximumCharactersRequired = calculateMaximumCharactersRequired(length, radix, x->digit(length - 1), sign);
 
     if (maximumCharactersRequired > JSString::MaxLength) {
-        auto scope = DECLARE_THROW_SCOPE(vm);
-        throwOutOfMemoryError(exec, scope);
+        if (exec) {
+            auto scope = DECLARE_THROW_SCOPE(vm);
+            throwOutOfMemoryError(exec, scope);            
+        }
         return String();
     }
 

Modified: trunk/Source/_javascript_Core/runtime/JSBigInt.h (248897 => 248898)


--- trunk/Source/_javascript_Core/runtime/JSBigInt.h	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/runtime/JSBigInt.h	2019-08-20 10:41:33 UTC (rev 248898)
@@ -86,6 +86,8 @@
     static JSBigInt* parseInt(ExecState*, StringView, ErrorParseMode = ErrorParseMode::ThrowExceptions);
     static JSBigInt* stringToBigInt(ExecState*, StringView);
 
+    static String tryGetString(VM&, JSBigInt*, unsigned radix);
+
     Optional<uint8_t> singleDigitValueForString();
     String toString(ExecState*, unsigned radix);
     
@@ -200,8 +202,8 @@
     static Digit digitDiv(Digit high, Digit low, Digit divisor, Digit& remainder);
     static Digit digitPow(Digit base, Digit exponent);
 
-    static String toStringBasePowerOfTwo(ExecState*, JSBigInt*, unsigned radix);
-    static String toStringGeneric(ExecState*, JSBigInt*, unsigned radix);
+    static String toStringBasePowerOfTwo(VM&, ExecState*, JSBigInt*, unsigned radix);
+    static String toStringGeneric(VM&, ExecState*, JSBigInt*, unsigned radix);
 
     inline bool isZero() const
     {

Modified: trunk/Source/_javascript_Core/runtime/RuntimeType.cpp (248897 => 248898)


--- trunk/Source/_javascript_Core/runtime/RuntimeType.cpp	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/runtime/RuntimeType.cpp	2019-08-20 10:41:33 UTC (rev 248898)
@@ -55,6 +55,8 @@
         return TypeFunction;
     if (value.isSymbol())
         return TypeSymbol;
+    if (value.isBigInt())
+        return TypeBigInt;
 
     return TypeNothing;
 }
@@ -77,6 +79,10 @@
         return "Boolean"_s;
     if (type == TypeFunction)
         return "Function"_s;
+    if (type == TypeSymbol)
+        return "Symbol"_s;
+    if (type == TypeBigInt)
+        return "BigInt"_s;
     if (type == TypeNothing)
         return "(Nothing)"_s;
 

Modified: trunk/Source/_javascript_Core/runtime/RuntimeType.h (248897 => 248898)


--- trunk/Source/_javascript_Core/runtime/RuntimeType.h	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/runtime/RuntimeType.h	2019-08-20 10:41:33 UTC (rev 248898)
@@ -41,12 +41,13 @@
     TypeNumber             = 0x20,
     TypeString             = 0x40,
     TypeObject             = 0x80,
-    TypeSymbol             = 0x100
+    TypeSymbol             = 0x100,
+    TypeBigInt             = 0x200,
 };
 
 typedef uint16_t RuntimeTypeMask;
 
-static const RuntimeTypeMask RuntimeTypeMaskAllTypes = TypeFunction | TypeUndefined | TypeNull | TypeBoolean | TypeAnyInt | TypeNumber | TypeString | TypeObject | TypeSymbol;
+static const RuntimeTypeMask RuntimeTypeMaskAllTypes = TypeFunction | TypeUndefined | TypeNull | TypeBoolean | TypeAnyInt | TypeNumber | TypeString | TypeObject | TypeSymbol | TypeBigInt;
 
 class JSValue;
 RuntimeType runtimeTypeForValue(VM&, JSValue);

Modified: trunk/Source/_javascript_Core/runtime/TypeSet.cpp (248897 => 248898)


--- trunk/Source/_javascript_Core/runtime/TypeSet.cpp	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/_javascript_Core/runtime/TypeSet.cpp	2019-08-20 10:41:33 UTC (rev 248898)
@@ -189,6 +189,8 @@
         return "String"_s;
     if (doesTypeConformTo(TypeSymbol))
         return "Symbol"_s;
+    if (doesTypeConformTo(TypeBigInt))
+        return "BigInt"_s;
 
     if (doesTypeConformTo(TypeNull | TypeUndefined))
         return "(?)"_s;
@@ -205,6 +207,8 @@
         return "String?"_s;
     if (doesTypeConformTo(TypeSymbol | TypeNull | TypeUndefined))
         return "Symbol?"_s;
+    if (doesTypeConformTo(TypeBigInt | TypeNull | TypeUndefined))
+        return "BigInt?"_s;
    
     if (doesTypeConformTo(TypeObject | TypeFunction | TypeString))
         return "Object"_s;
@@ -241,6 +245,7 @@
         .setIsString((m_seenTypes & TypeString) != TypeNothing)
         .setIsObject((m_seenTypes & TypeObject) != TypeNothing)
         .setIsSymbol((m_seenTypes & TypeSymbol) != TypeNothing)
+        .setIsBigInt((m_seenTypes & TypeBigInt) != TypeNothing)
         .release();
 }
 

Modified: trunk/Source/WebInspectorUI/ChangeLog (248897 => 248898)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-08-20 10:41:33 UTC (rev 248898)
@@ -1,3 +1,59 @@
+2019-08-20  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Support for _javascript_ BigInt
+        https://bugs.webkit.org/show_bug.cgi?id=180731
+        <rdar://problem/36298748>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/External/CodeMirror/_javascript_.js:
+        (expressionAllowed):
+        Cherry-pick BigInt _javascript_ mode support from CodeMirror:
+        https://github.com/codemirror/CodeMirror/pull/5411
+
+        * UserInterface/Images/TypeBigInt.svg: Added.
+        * UserInterface/Views/Variables.css:
+        (:root):
+        (@media (prefers-color-scheme: dark)):
+        * UserInterface/Views/CodeMirrorAdditions.js:
+        * UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
+        (.cm-s-default .cm-number.cm-bigint,):
+        * UserInterface/Views/ObjectTreePropertyTreeElement.css:
+        (.object-tree-property.bigint > .icon):
+        * UserInterface/Views/HeapSnapshotInstancesContentView.css:
+        (.heap-snapshot .icon.bigint):
+        Style BigInt similiar but different from numbers but with
+        a [B] icon instead of [N].
+
+        * UserInterface/Views/FormattedValue.css:
+        (.formatted-bigint):
+        * UserInterface/Views/FormattedValue.js:
+        (WI.FormattedValue.hasSimpleDisplay):
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
+        (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
+        Simple value formatting for the new type.
+
+        * UserInterface/Models/TypeSet.js:
+        (WI.TypeSet):
+        (WI.TypeSet.prototype.get primitiveTypeNames):
+        * UserInterface/Views/TypeTokenView.css:
+        (.type-token-bigint):
+        * UserInterface/Views/TypeTokenView.js:
+        (WI.TypeTokenView.prototype._displayTypeName):
+        (WI.TypeTokenView):
+        New type handling for the Type profiler.
+
+        * UserInterface/Protocol/RemoteObject.js:
+        (WI.RemoteObject):
+        (WI.RemoteObject.createBigIntFromDescriptionString):
+        * UserInterface/Views/HeapSnapshotClusterContentView.js:
+        (WI.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
+        * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
+        (WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
+        BigInt values are not tied to a GlobalObject, so do some special casing
+        in the Heap output (like Strings) so we get a preview.
+
 2019-08-20  Devin Rousso  <[email protected]>
 
         Web Inspector: Use URL constructor to better handle all kinds of URLs

Modified: trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/_javascript_.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/_javascript_.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/_javascript_.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -112,17 +112,10 @@
       return ret(ch);
     } else if (ch == "=" && stream.eat(">")) {
       return ret("=>", "operator");
-    } else if (ch == "0" && stream.eat(/x/i)) {
-      stream.eatWhile(/[\da-f]/i);
+    } else if (ch == "0" && stream.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i)) {
       return ret("number", "number");
-    } else if (ch == "0" && stream.eat(/o/i)) {
-      stream.eatWhile(/[0-7]/i);
-      return ret("number", "number");
-    } else if (ch == "0" && stream.eat(/b/i)) {
-      stream.eatWhile(/[01]/i);
-      return ret("number", "number");
     } else if (/\d/.test(ch)) {
-      stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
+      stream.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/);
       return ret("number", "number");
     } else if (ch == "/") {
       if (stream.eat("*")) {

Added: trunk/Source/WebInspectorUI/UserInterface/Images/TypeBigInt.svg (0 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Images/TypeBigInt.svg	                        (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/TypeBigInt.svg	2019-08-20 10:41:33 UTC (rev 248898)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright © 2019 Apple Inc. All rights reserved. -->
+<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
+    <path fill="hsl(192, 50%, 75%)" d="M 13 1 L 3 1 C 1.9 1 1 1.9 1 3 L 1 13 C 1 14.1 1.9 15 3 15 L 13 15 C 14.1 15 15 14.1 15 13 L 15 3 C 15 1.9 14.1 1 13 1 L 13 1 Z"/>
+    <path fill="hsl(192, 48%, 45%)" d="M 13 1 L 3 1 C 1.9 1 1 1.9 1 3 L 1 13 C 1 14.1 1.9 15 3 15 L 13 15 C 14.1 15 15 14.1 15 13 L 15 3 C 15 1.9 14.1 1 13 1 M 13 2 C 13.552 2 14 2.449 14 3 L 14 13 C 14 13.552 13.552 14 13 14 L 3 14 C 2.449 14 2 13.552 2 13 L 2 3 C 2 2.449 2.449 2 3 2 L 13 2"/>
+    <path fill="hsl(192, 40%, 50%)" d="M 7.7266 9.8457 L 7.7266 9.5417 C 7.7836 9.568701 7.8366 9.5987 7.8856 9.6337 C 7.9926 9.7117 8.0186 9.7607 8.025599 9.7997 C 7.9596 9.8147 7.8636 9.8317 7.7266 9.8457 M 7.9306 3.0457 L 5.0876 3.0457 L 4.0876 3.0457 L 4.0876 4.0457 L 4.0876 11.999701 L 4.0876 12.999701 L 5.0876 12.999701 L 8.190599 12.999701 C 9.2586 12.999701 10.1216 12.7637 10.7536 12.2987 C 11.4706 11.7637 11.8476 10.9817 11.8476 10.0337 C 11.8476 9.419701 11.6646 8.485701 10.7176 7.7477 C 11.3386 7.1267 11.5086 6.4107 11.5086 5.8137 C 11.5086 4.9037 11.1306 4.1627 10.4156 3.6727 C 9.8006 3.2507 8.987599 3.0457 7.9306 3.0457 M 6.7266 10.8717 L 7.1006 10.8717 C 7.8306 10.8717 8.3356 10.7967 8.6116 10.6477 C 8.8896 10.499701 9.027599 10.228701 9.027599 9.8347 C 9.027599 9.428699 8.841599 9.0927 8.4716 8.8237 C 8.0996 8.554701 7.6316 8.4207 7.0656 8.4207 L 6.7266 8.4207 L 6.7266 10.8717 M 6.7266 7.3567 L 7.1396 7.3567 C 7.6286 7.3567 8.0186 7.2417 8.3056 7.012
 7 C 8.5956 6.782701 8.7386 6.471701 8.7386 6.077701 C 8.7386 5.7117 8.6226 5.4637 8.3926 5.3337 C 8.1586 5.2027 7.7216 5.1377 7.0776 5.1377 L 6.7266 5.1377 L 6.7266 7.3567 M 7.9306 4.0457 C 8.770599 4.0457 9.4116 4.1967 9.850599 4.4977 C 10.2896 4.7987 10.5086 5.2377 10.5086 5.8137 C 10.5086 6.7707 9.8386 7.447701 8.501599 7.8457 C 10.0656 8.207701 10.8476 8.936701 10.8476 10.0337 C 10.8476 10.6677 10.6186 11.1527 10.1616 11.492701 C 9.7036 11.8297 9.0456 11.999701 8.190599 11.999701 L 5.0876 11.999701 L 5.0876 4.0457 L 7.9306 4.0457"/>
+    <path fill="white" d="M 6.7266 10.872101 L 7.1006 10.872101 C 7.8306 10.872101 8.3356 10.7971 8.6116 10.6471 C 8.8896 10.5001 9.027599 10.2281 9.027599 9.8351 C 9.027599 9.4291 8.841599 9.0931 8.4716 8.8241 C 8.0996 8.555099 7.6316 8.421101 7.0656 8.421101 L 6.7266 8.421101 L 6.7266 10.872101 Z M 6.7266 7.3571 L 7.1396 7.3571 C 7.6286 7.3571 8.0186 7.2421 8.3056 7.013101 C 8.5956 6.7831 8.7386 6.4721 8.7386 6.0781 C 8.7386 5.7121 8.6226 5.4641 8.3926 5.3331 C 8.1586 5.2031 7.7216 5.1371 7.0776 5.1371 L 6.7266 5.1371 L 6.7266 7.3571 Z M 5.0876 12.0001 L 5.0876 4.0461 L 7.9306 4.0461 C 8.770599 4.0461 9.4116 4.1961 9.850599 4.4971 C 10.2896 4.7981 10.5086 5.2371 10.5086 5.8141 C 10.5086 6.770101 9.8386 7.4481 8.501599 7.8461 C 10.0656 8.2071 10.8476 8.9361 10.8476 10.0331 C 10.8476 10.6681 10.6186 11.1521 10.1616 11.4931 C 9.7036 11.8301 9.0456 12.0001 8.190599 12.0001 L 5.0876 12.0001 Z"/>
+</svg>

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TypeSet.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Models/TypeSet.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TypeSet.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -49,6 +49,8 @@
             bitString |= WI.TypeSet.TypeBit.Object;
         if (typeSet.isSymbol)
             bitString |= WI.TypeSet.TypeBit.Symbol;
+        if (typeSet.isBigInt)
+            bitString |= WI.TypeSet.TypeBit.BigInt;
         console.assert(bitString);
 
         this._typeSet = typeSet;
@@ -102,6 +104,8 @@
             this._primitiveTypeNames.push("String");
         if (typeSet.isSymbol)
             this._primitiveTypeNames.push("Symbol");
+        if (typeSet.isBigInt)
+            this._primitiveTypeNames.push("BigInt");
 
         // It's implied that type Integer is contained in type Number. Don't put
         // both 'Integer' and 'Number' into the set because this could imply that
@@ -124,7 +128,8 @@
     "Number"      :  0x20,
     "String"      :  0x40,
     "Object"      :  0x80,
-    "Symbol"      :  0x100
+    "Symbol"      :  0x100,
+    "BigInt"      :  0x200,
 };
 
 WI.TypeSet.NullOrUndefinedTypeBits = WI.TypeSet.TypeBit.Null | WI.TypeSet.TypeBit.Undefined;

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -59,7 +59,7 @@
                 this._description = "class " + className;
             }
         } else {
-            // Primitive or null.
+            // Primitive, BigInt, or null.
             console.assert(type !== "object" || value === null);
             console.assert(!preview);
 
@@ -66,6 +66,15 @@
             this._description = description || (value + "");
             this._hasChildren = false;
             this._value = value;
+
+            if (type === "bigint") {
+                console.assert(value === undefined);
+                console.assert(description.endsWith("n"));
+                if (window.BigInt)
+                    this._value = BigInt(description.substring(0, description.length - 1));
+                else
+                    this._value = `${description} [BigInt Not Enabled in Web Inspector]`;
+            }
         }
     }
 
@@ -81,6 +90,13 @@
         return new WI.RemoteObject(undefined, undefined, typeof value, undefined, value, undefined, undefined, undefined, undefined);
     }
 
+    static createBigIntFromDescriptionString(description)
+    {
+        console.assert(description.endsWith("n"));
+
+        return new WI.RemoteObject(undefined, undefined, "bigint", undefined, undefined, description, undefined, undefined, undefined);
+    }
+
     static fromPayload(payload, target)
     {
         console.assert(typeof payload === "object", "Remote object payload should only be an object");

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -325,11 +325,15 @@
         return style && (style + " m-" + (this.alternateName || this.name));
     }
 
-    function extendedToken(stream, state)
+    function extendedJavaScriptToken(stream, state)
     {
         // CodeMirror moves the original token function to _token when we extended it.
         // So call it to get the style that we will add an additional class name to.
         var style = this._token(stream, state);
+
+        if (style === "number" && stream.current().endsWith("n"))
+            style += " bigint";
+
         return style && (style + " m-" + (this.alternateName || this.name));
     }
 
@@ -360,7 +364,7 @@
 
     CodeMirror.extendMode("css", {token: extendedCSSToken});
     CodeMirror.extendMode("xml", {token: extendedXMLToken});
-    CodeMirror.extendMode("_javascript_", {token: extendedToken});
+    CodeMirror.extendMode("_javascript_", {token: extendedJavaScriptToken});
 
     CodeMirror.defineInitHook(function(codeMirror) {
         codeMirror.on("scrollCursorIntoView", scrollCursorIntoView);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css	2019-08-20 10:41:33 UTC (rev 248898)
@@ -58,6 +58,10 @@
     color: var(--syntax-highlight-symbol-color);
 }
 
+.formatted-bigint {
+    color: var(--syntax-highlight-bigint-color);
+}
+
 .formatted-null, .formatted-undefined {
     color: hsl(0, 0%, 50%);
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -32,6 +32,7 @@
     case "number":
     case "string":
     case "symbol":
+    case "bigint":
     case "undefined":
         return true;
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -95,6 +95,9 @@
         case "Symbol":
         case "symbol":
             return "symbol";
+        case "BigInt":
+        case "bigint":
+            return "bigint";
         }
 
         if (className.endsWith("Prototype"))

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -299,8 +299,13 @@
             }
 
             if (string) {
-                let primitiveRemoteObject = WI.RemoteObject.fromPrimitiveValue(string);
-                containerElement.appendChild(WI.FormattedValue.createElementForRemoteObject(primitiveRemoteObject));
+                if (this._node.className === "BigInt") {
+                    let bigIntRemoteObject = WI.RemoteObject.createBigIntFromDescriptionString(string + "n");
+                    containerElement.appendChild(WI.FormattedValue.createElementForRemoteObject(bigIntRemoteObject));
+                } else {
+                    let primitiveRemoteObject = WI.RemoteObject.fromPrimitiveValue(string);
+                    containerElement.appendChild(WI.FormattedValue.createElementForRemoteObject(primitiveRemoteObject));
+                }
                 return;
             }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css	2019-08-20 10:41:33 UTC (rev 248898)
@@ -111,6 +111,10 @@
     content: url(../Images/TypeNumber.svg);
 }
 
+.heap-snapshot .icon.bigint {
+    content: url(../Images/TypeBigInt.svg);
+}
+
 .heap-snapshot .icon.object {
     content: url(../Images/TypeObject.svg);
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.css (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.css	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.css	2019-08-20 10:41:33 UTC (rev 248898)
@@ -40,6 +40,10 @@
     content: url(../Images/TypeNumber.svg);
 }
 
+.object-tree-property.bigint > .icon {
+    content: url(../Images/TypeBigInt.svg);
+}
+
 .object-tree-property.object > .icon {
     content: url(../Images/TypeObject.svg);
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -1771,8 +1771,9 @@
             case "string":
             case "number":
             case "boolean":
+            case "symbol":
+            case "bigint":
             case "undefined":
-            case "symbol":
                 this._showPopoverWithFormattedValue(data);
                 break;
             }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css	2019-08-20 10:41:33 UTC (rev 248898)
@@ -49,6 +49,11 @@
     color: var(--syntax-highlight-number-color);
 }
 
+.cm-s-default .cm-number.cm-bigint,
+.syntax-highlighted ._javascript_-bigint {
+    color: var(--syntax-highlight-bigint-color);
+}
+
 .cm-s-default :matches(.cm-def, .cm-operator, .cm-variable, .cm-variable-2),
 .cm-s-default .cm-m-css:matches(.cm-tag, .cm-string-2, .cm-builtin, .cm-qualifier),
 .syntax-highlighted :matches(.css-property, .css-selector, ._javascript_-ident) {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.css (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.css	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.css	2019-08-20 10:41:33 UTC (rev 248898)
@@ -59,6 +59,10 @@
     background-color: var(--syntax-highlight-symbol-color);
 }
 
+.type-token-bigint {
+    background-color: var(--syntax-highlight-bigint-color);
+}
+
 .type-token-default {
     background-color: hsl(83, 71%, 39%);
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js	2019-08-20 10:41:33 UTC (rev 248898)
@@ -160,6 +160,8 @@
             return "String";
         if (typeSet.isContainedIn(WI.TypeSet.TypeBit.Symbol))
             return "Symbol";
+        if (typeSet.isContainedIn(WI.TypeSet.TypeBit.BigInt))
+            return "BigInt";
 
         if (typeSet.isContainedIn(WI.TypeSet.NullOrUndefinedTypeBits))
             return "(?)";
@@ -176,6 +178,8 @@
             return "String?";
         if (typeSet.isContainedIn(WI.TypeSet.TypeBit.Symbol | WI.TypeSet.NullOrUndefinedTypeBits))
             return "Symbol?";
+        if (typeSet.isContainedIn(WI.TypeSet.TypeBit.BigInt | WI.TypeSet.NullOrUndefinedTypeBits))
+            return "BigInt?";
 
         if (typeSet.isContainedIn(WI.TypeSet.TypeBit.Object | WI.TypeSet.TypeBit.Function | WI.TypeSet.TypeBit.String))
             return "Object";
@@ -194,6 +198,7 @@
 WI.TypeTokenView.ColorClassForType = {
     "String": "type-token-string",
     "Symbol": "type-token-symbol",
+    "BigInt": "type-token-bigint",
     "Function": "type-token-function",
     "Number": "type-token-number",
     "Integer": "type-token-number",

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css (248897 => 248898)


--- trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css	2019-08-20 10:41:33 UTC (rev 248898)
@@ -103,6 +103,7 @@
     --value-changed-highlight: hsla(83, 100%, 48%, 0.4);
 
     --syntax-highlight-number-color: hsl(248, 100%, 40%);
+    --syntax-highlight-bigint-color: hsl(192, 100%, 38%);
     --syntax-highlight-boolean-color: hsl(309, 85%, 35%);
     --syntax-highlight-string-color: hsl(1, 79%, 42%);
     --syntax-highlight-link-color: hsl(240, 100%, 52%);
@@ -282,6 +283,7 @@
         --value-visual-highlight: var(--yellow-highlight-background-color);
 
         --syntax-highlight-number-color: hsl(276, 100%, 85%);
+        --syntax-highlight-bigint-color: hsl(195, 100%, 85%);
         --syntax-highlight-boolean-color: hsl(299, 71%, 80%);
         --syntax-highlight-string-color: hsl(28, 84%, 63%);
         --syntax-highlight-link-color: hsl(223, 100%, 77%);
@@ -288,7 +290,6 @@
         --syntax-highlight-regexp-color: hsl(20, 100%, 64%);
         --syntax-highlight-symbol-color: hsl(172, 45%, 65%);
         --syntax-highlight-comment-color: hsl(119, 40%, 72%);
-        --syntax-highlight-regex-group-color: var(--text-color-gray-medium);
 
         --console-secondary-text-color: hsla(0, 0%, 100%, 0.45);
 

Modified: trunk/Source/WebKit/ChangeLog (248897 => 248898)


--- trunk/Source/WebKit/ChangeLog	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebKit/ChangeLog	2019-08-20 10:41:33 UTC (rev 248898)
@@ -1,3 +1,16 @@
+2019-08-20  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Support for _javascript_ BigInt
+        https://bugs.webkit.org/show_bug.cgi?id=180731
+        <rdar://problem/36298748>
+
+        Reviewed by Devin Rousso.
+
+        * WebProcess/WebPage/WebInspectorUI.cpp:
+        (WebKit::WebInspectorUI::WebInspectorUI):
+        Enable BigInt in the Web Inspector process. It only makes use of
+        `globalThis.BigInt(...)` to hold the value.
+
 2019-08-19  Fujii Hironori  <[email protected]>
 
         [CMake] WebKit2.dll can't link because of missing PAL's import symbols for WinCairo port

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp (248897 => 248898)


--- trunk/Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp	2019-08-20 09:48:20 UTC (rev 248897)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp	2019-08-20 10:41:33 UTC (rev 248898)
@@ -51,6 +51,8 @@
     : m_page(page)
     , m_frontendAPIDispatcher(page)
 {
+    JSC::Options::useBigInt() = true;
+        
     RuntimeEnabledFeatures::sharedFeatures().setInspectorAdditionsEnabled(true);
     RuntimeEnabledFeatures::sharedFeatures().setImageBitmapOffscreenCanvasEnabled(true);
 #if ENABLE(WEBGL2)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to