compile method

Uint8List compile(
  1. String content, {
  2. String? sourceName,
  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.

Implementation

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