-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support BigInt literals in JavaScript #5411
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marijnh
added a commit
that referenced
this pull request
May 22, 2018
yury-s
pushed a commit
to yury-s/webkit-http
that referenced
this pull request
Aug 20, 2019
https://bugs.webkit.org/show_bug.cgi?id=180731 <rdar://problem/36298748> Source/JavaScriptCore: 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: codemirror/codemirror5#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. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@248898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
cone56
pushed a commit
to cone56/CodeMirror
that referenced
this pull request
Jan 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for BigInt literal syntax:
10n
is highlighted as[number 10n]
instead of[number 10][variable n]
. Not sure what the policy on 'when is soon enough' to implement language features - this one's quite fresh: it's a stage 3 proposal, shipped in Chrome Canary. The BigInt interface is implemented in JSC and SpiderMonkey, but afaict, the literal syntax isn't yet.Todo:
References: