compile method

Uint8List compile(
  1. String content, {
  2. String? filename,
  3. CompilerConfig? config,
  4. bool isModuleEntryScript = false,
  5. Version? version,
})

Compile a string into bytecode. This won't execute the code, so runtime errors will not be reported. If config is provided, it replaces the initialization compiler config for this compilation only.

Implementation

Uint8List compile(
  String content, {
  String? filename,
  CompilerConfig? config,
  bool isModuleEntryScript = false,
  Version? version,
}) {
  final source = HTSource(content,
      filename: filename,
      type: isModuleEntryScript
          ? HTResourceType.hetuScript
          : HTResourceType.hetuModule);
  return _compileSource(
    source,
    version: version,
    config: config,
  );
}