j0j00 / flutter_liquidcore

Node.js virtual machine for Android and iOS in Flutter.
https://pub.dev/packages/flutter_liquidcore
BSD 2-Clause "Simplified" License
67 stars 16 forks source link

Using JSContext not able to execute functions in Javascript #18

Closed braj065 closed 4 years ago

braj065 commented 4 years ago

If i am trying to execute a JS function as follows - function show_number(){return 10+7;}() I am getting error that 'SyntaxError: Unexpected token )'

_jsContext.evaluateScript('function show_random_number(){return 10+7;}()');

j0j00 commented 4 years ago

The GitHub issues are for bugs in the library. This is an issue with your code.

It's not valid JavaScript, hence the syntax error.

Questions like this are more for stackoverflow.