compileExpressionToJs abstract method

Future<ExpressionCompilationResult> compileExpressionToJs(
  1. String isolateId,
  2. String libraryUri,
  3. int line,
  4. int column,
  5. Map<String, String> jsModules,
  6. Map<String, String> jsFrameValues,
  7. String moduleName,
  8. String expression
)

Compiles expression in libraryUri at line:column to JavaScript in moduleName.

Values listed in jsFrameValues are substituted for their names in the expression.

Ensures that all jsModules are loaded and accessible inside the expression.

Returns ExpressionCompilationResult Errors are reported using onDiagnostic function moduleName is of the form '/packages/hello_world_main.dart' jsFrameValues is a map from js variable name to its primitive value or another variable name, for example { 'x': '1', 'y': 'y', 'o': 'null' } jsModules is a map from variable name to the module name, where variable name is the name originally used in JavaScript to contain the module object, for example: { 'dart':'dart_sdk', 'main': '/packages/hello_world_main.dart' }

Should wait for the dependencies to update if called during a call to updateDependencies.

Implementation

Future<ExpressionCompilationResult> compileExpressionToJs(
  String isolateId,
  String libraryUri,
  int line,
  int column,
  Map<String, String> jsModules,
  Map<String, String> jsFrameValues,
  String moduleName,
  String expression,
);