abner / flutter_js

A Javascript engine to use with flutter. It uses quickjs on Android and JavascriptCore on IOS
MIT License
473 stars 124 forks source link

QuickJS and JavaScriptCore behave inconsistently. #143

Open widealpha opened 11 months ago

widealpha commented 11 months ago

Is there a way to remove the JSON.stringify method from handle_promise.dart, specifically from JSON.stringify(FLUTTER_NATIVEJS_PENDING_PROMISES[$idxPromise].getValue())(line 153-155)? When I return a JSON string from the native side, using JavaScriptCore results in double-serialization, causing inconsistency with QuickJs return values. Is there a specific reason for this design? image

version: flutter_js: ^0.8.0

abner commented 5 months ago

Could be fixed. Are you able to submit a PR? I would review it.

widealpha commented 5 months ago

I have submitted a PR #152. I think this is a break change.