abner / flutter_js

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

QuickJS and JavaScriptCore behave inconsistently. #143

Open widealpha opened 7 months ago

widealpha commented 7 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 1 month ago

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

widealpha commented 1 month ago

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