MCPcopy Create free account
hub / github.com/dop251/goja / runTC39Script

Method runTC39Script

tc39_test.go:751–781  ·  view source on GitHub ↗
(name, src string, includes []string, vm *Runtime)

Source from the content-addressed store, hash-verified

749}
750
751func (ctx *tc39TestCtx) runTC39Script(name, src string, includes []string, vm *Runtime) (err error, early bool) {
752 early = true
753 err = ctx.runFile(ctx.base, path.Join("harness", "assert.js"), vm)
754 if err != nil {
755 return
756 }
757
758 err = ctx.runFile(ctx.base, path.Join("harness", "sta.js"), vm)
759 if err != nil {
760 return
761 }
762
763 for _, include := range includes {
764 err = ctx.runFile(ctx.base, path.Join("harness", include), vm)
765 if err != nil {
766 return
767 }
768 }
769
770 var p *Program
771 p, err = Compile(name, src, false)
772
773 if err != nil {
774 return
775 }
776
777 early = false
778 _, err = vm.RunProgram(p)
779
780 return
781}
782
783func (ctx *tc39TestCtx) runTC39Tests(name string) {
784 files, err := os.ReadDir(path.Join(ctx.base, name))

Callers 1

runTC39TestMethod · 0.95

Calls 3

runFileMethod · 0.95
CompileFunction · 0.85
RunProgramMethod · 0.80

Tested by

no test coverage detected