Skip to content
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

How to import INTL or other dependencies? #148

Open
Naografix opened this issue Mar 19, 2024 · 1 comment
Open

How to import INTL or other dependencies? #148

Naografix opened this issue Mar 19, 2024 · 1 comment

Comments

@Naografix
Copy link

Naografix commented Mar 19, 2024

Hello, i'm playing with Flutter_js and I have a little problem right now:

This is my test.js (from Mozilla Doc) :

function log(count) {
   const formattedCount = new Intl.NumberFormat(navigator.languages).format(count);
   return formattedCount;
}

My page.dart:

var myMethod = "log(26254.39);";
var flutterJs = getJavascriptRuntime();
var path = await rootBundle.loadString("lib/core/ressources/test.js");
JsEvalResult jsEvalResult = flutterJs.evaluate("$path$myMethod");
var result = jsEvalResult.stringResult;

And this is my error:

I/flutter (16439): ReferenceError: 'Intl' is not defined
I/flutter (16439): at log (:3)
I/flutter (16439): at (:5)

How to import INTL for my javascript process?

Thanks

@liruohrh
Copy link

  • I think it's because quickjs has not implement Intl.
  • you should evaluate or load module about Intl,
    • or modify quickjs c lib(difficulty)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants