evalRaw method

Future<String> evalRaw(
  1. String code, {
  2. Duration? timeout,
  3. String name = '<eval>',
  4. Map<String, Object?> tempGlobals = const {},
})

同步求值 code 并返回底层 Bridge 的原始字符串。

Implementation

Future<String> evalRaw(
  String code, {

  /// 从任务入队开始计算的总时限,包含排队和 JavaScript 执行时间。
  Duration? timeout,

  /// 本次执行的源码名称,用于错误堆栈、诊断信息和 source map 匹配。
  String name = '<eval>',
  Map<String, Object?> tempGlobals = const {},
}) {
  _ensureOpen();
  return _engine.evalRaw(
    code,
    timeout: timeout,
    name: name,
    tempGlobals: tempGlobals,
  );
}