robertkrimen / otto

A JavaScript interpreter in Go (golang)
http://godoc.org/github.com/robertkrimen/otto
MIT License
8.04k stars 584 forks source link

Question: How to run `export default { entry: './src/index.ts' } ` #438

Closed renzp94 closed 2 years ago

renzp94 commented 2 years ago

I have a file config.ts, the content is export default { entry: './src/index.ts' }. I want get struct {entry: './src/index.ts'}. I try vm.Run, error: (anonymous): Line 1:1 Unexpected reserved word What shall I do? I hope you can answer my questions. Thank you very much

Asday commented 2 years ago

Otto targets ES5. ES6 features (eg: Typed Arrays) are not supported.

https://github.com/robertkrimen/otto#caveat-emptor

Typescript is not javascript.

renzp94 commented 2 years ago

ok.Thanks.