package
Version:
v0.27.1
Opens a new window with list of versions in this module.
Published: Jul 30, 2020
License: AGPL-3.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
- Variables
-
type Compiler
-
func (c *Compiler) Compile(src, filename, pre, post string, strict bool, compatMode lib.CompatibilityMode) (*goja.Program, string, error)
-
func (c *Compiler) Transform(src, filename string) (code string, srcmap *SourceMap, err error)
-
type SourceMap
View Source
var (
DefaultOpts = map[string]interface{}{
"presets": []string{"latest"},
"ast": false,
"sourceMaps": false,
"babelrc": false,
"compact": false,
"retainLines": true,
"highlightCode": false,
}
)
A Compiler compiles JavaScript source code (ES5.1 or ES6) into a goja.Program
New returns a new Compiler
Compile the program in the given CompatibilityMode, optionally running pre and post code.
Transform the given code into ES5
Source Files
¶
Click to show internal directories.
Click to hide internal directories.