| 84 | } |
| 85 | |
| 86 | func (c *Compiler) Compiler(script string) interface{} { |
| 87 | runtimeError := os.Getenv(RuntimeError) |
| 88 | if runtimeError != "" { |
| 89 | defer func() { |
| 90 | if r := recover(); r != nil { |
| 91 | switch x := r.(type) { |
| 92 | case *log.Log: |
| 93 | fmt.Printf("runtime error: %s \n", x.String()) |
| 94 | default: |
| 95 | panic(x) |
| 96 | } |
| 97 | } |
| 98 | }() |
| 99 | } |
| 100 | native := c.loadInternal() |
| 101 | script = native + script |
| 102 | return c.compile(script) |
| 103 | } |
| 104 | |
| 105 | func (c *Compiler) loadInternal() string { |
| 106 | bytes, err := internal.Asset("internal/internal.gs") |