prototype: Browser support Map<String,Object> (JS objects) in JSON codec - #3494
Open
laeubi wants to merge 1 commit into
Open
prototype: Browser support Map<String,Object> (JS objects) in JSON codec#3494laeubi wants to merge 1 commit into
laeubi wants to merge 1 commit into
Conversation
Contributor
This file contains hidden or 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
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.
Currently BrowserFunction/Evaluate only supports primitives and arrays but not objects.
This is a prototype to add support for having a
Map<String, Object>support, but is not complete because Object/Map support is inconsistent across the 4 native backends because they use two different marshalling strategies:So JSON.java is only the actual conversion path for Edge (fully) and for WebKitGTK's BrowserFunction call marshalling (function args come in via a swt:// URL query string that's JSON-encoded, and the return value is JSON-stringified back to JS). The other native paths inspect JS values directly (JSC API, WebScriptObject, IDispatch) and only ever check for arrays via a length property/index — no key enumeration exists for plain objects.
I still wanted to share this here for gathering feedback of others, if such partial support would be helpful (windows+linux) and possibly ideas how we can streamline this across different OS. My main workaround currently is to start a local webserver and using rest calls, but this is a bit brittle and not always possible due to restricted environments.