goscript 0.0.40 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/analysis.go +173 -2
- package/compiler/compiler.go +14 -4
- package/compiler/expr-type.go +25 -0
- package/compiler/field.go +4 -4
- package/compiler/spec.go +1 -1
- package/compiler/stmt.go +118 -17
- package/compiler/type.go +19 -4
- package/dist/gs/builtin/builtin.d.ts +10 -8
- package/dist/gs/builtin/builtin.js +14 -53
- package/dist/gs/builtin/builtin.js.map +1 -1
- package/dist/gs/builtin/errors.d.ts +8 -0
- package/dist/gs/builtin/errors.js +18 -0
- package/dist/gs/builtin/errors.js.map +1 -0
- package/dist/gs/builtin/index.d.ts +7 -0
- package/dist/gs/builtin/index.js +7 -0
- package/dist/gs/builtin/index.js.map +1 -1
- package/dist/gs/builtin/slice.d.ts +5 -2
- package/dist/gs/builtin/slice.js +110 -77
- package/dist/gs/builtin/slice.js.map +1 -1
- package/dist/gs/bytes/buffer.gs.d.ts +1 -1
- package/dist/gs/bytes/buffer.gs.js +1 -1
- package/dist/gs/bytes/buffer.gs.js.map +1 -1
- package/dist/gs/bytes/bytes.gs.d.ts +1 -1
- package/dist/gs/bytes/bytes.gs.js +1 -1
- package/dist/gs/bytes/bytes.gs.js.map +1 -1
- package/dist/gs/bytes/iter.gs.d.ts +1 -1
- package/dist/gs/bytes/iter.gs.js +1 -1
- package/dist/gs/bytes/iter.gs.js.map +1 -1
- package/dist/gs/bytes/reader.gs.d.ts +1 -1
- package/dist/gs/bytes/reader.gs.js +1 -1
- package/dist/gs/bytes/reader.gs.js.map +1 -1
- package/dist/gs/context/context.d.ts +1 -1
- package/dist/gs/context/context.js +1 -1
- package/dist/gs/context/context.js.map +1 -1
- package/dist/gs/errors/errors.d.ts +1 -1
- package/dist/gs/errors/errors.js +3 -15
- package/dist/gs/errors/errors.js.map +1 -1
- package/dist/gs/github.com/pkg/errors/errors.d.ts +1 -1
- package/dist/gs/github.com/pkg/errors/errors.js +1 -1
- package/dist/gs/github.com/pkg/errors/errors.js.map +1 -1
- package/dist/gs/github.com/pkg/errors/go113.d.ts +1 -1
- package/dist/gs/github.com/pkg/errors/go113.js +1 -1
- package/dist/gs/github.com/pkg/errors/go113.js.map +1 -1
- package/dist/gs/github.com/pkg/errors/stack.d.ts +1 -1
- package/dist/gs/github.com/pkg/errors/stack.js +1 -1
- package/dist/gs/github.com/pkg/errors/stack.js.map +1 -1
- package/dist/gs/internal/byteorder/index.d.ts +1 -1
- package/dist/gs/internal/byteorder/index.js +1 -1
- package/dist/gs/internal/byteorder/index.js.map +1 -1
- package/dist/gs/internal/oserror/errors.d.ts +1 -1
- package/dist/gs/io/fs/format.js +1 -1
- package/dist/gs/io/fs/format.js.map +1 -1
- package/dist/gs/io/fs/fs.d.ts +1 -1
- package/dist/gs/io/fs/fs.js +1 -1
- package/dist/gs/io/fs/fs.js.map +1 -1
- package/dist/gs/io/fs/glob.d.ts +1 -1
- package/dist/gs/io/fs/glob.js +1 -1
- package/dist/gs/io/fs/glob.js.map +1 -1
- package/dist/gs/io/fs/readdir.d.ts +1 -1
- package/dist/gs/io/fs/readdir.js +1 -1
- package/dist/gs/io/fs/readdir.js.map +1 -1
- package/dist/gs/io/fs/readfile.d.ts +1 -1
- package/dist/gs/io/fs/readfile.js +1 -1
- package/dist/gs/io/fs/readfile.js.map +1 -1
- package/dist/gs/io/fs/stat.d.ts +1 -1
- package/dist/gs/io/fs/stat.js +1 -1
- package/dist/gs/io/fs/stat.js.map +1 -1
- package/dist/gs/io/fs/sub.d.ts +1 -1
- package/dist/gs/io/fs/sub.js +1 -1
- package/dist/gs/io/fs/sub.js.map +1 -1
- package/dist/gs/io/fs/walk.d.ts +1 -1
- package/dist/gs/io/fs/walk.js +1 -1
- package/dist/gs/io/fs/walk.js.map +1 -1
- package/dist/gs/io/io.d.ts +1 -1
- package/dist/gs/maps/iter.d.ts +1 -1
- package/dist/gs/maps/iter.js +1 -1
- package/dist/gs/maps/iter.js.map +1 -1
- package/dist/gs/maps/maps.d.ts +1 -1
- package/dist/gs/maps/maps.js +1 -1
- package/dist/gs/maps/maps.js.map +1 -1
- package/dist/gs/math/erfinv.gs.js +1 -1
- package/dist/gs/math/erfinv.gs.js.map +1 -1
- package/dist/gs/math/gamma.gs.js +1 -1
- package/dist/gs/math/gamma.gs.js.map +1 -1
- package/dist/gs/math/j0.gs.js +1 -1
- package/dist/gs/math/j0.gs.js.map +1 -1
- package/dist/gs/math/j1.gs.js +1 -1
- package/dist/gs/math/j1.gs.js.map +1 -1
- package/dist/gs/math/lgamma.gs.js +1 -1
- package/dist/gs/math/lgamma.gs.js.map +1 -1
- package/dist/gs/math/pow10.gs.js +1 -1
- package/dist/gs/math/pow10.gs.js.map +1 -1
- package/dist/gs/math/sin.gs.js +1 -1
- package/dist/gs/math/sin.gs.js.map +1 -1
- package/dist/gs/math/tan.gs.js +1 -1
- package/dist/gs/math/tan.gs.js.map +1 -1
- package/dist/gs/math/tanh.gs.js +1 -1
- package/dist/gs/math/tanh.gs.js.map +1 -1
- package/dist/gs/math/trig_reduce.gs.js +1 -1
- package/dist/gs/math/trig_reduce.gs.js.map +1 -1
- package/dist/gs/os/dir.gs.d.ts +1 -1
- package/dist/gs/os/dir_unix.gs.d.ts +1 -1
- package/dist/gs/os/dir_unix.gs.js +1 -1
- package/dist/gs/os/dir_unix.gs.js.map +1 -1
- package/dist/gs/os/dirent_js.gs.d.ts +1 -1
- package/dist/gs/os/env.gs.d.ts +1 -1
- package/dist/gs/os/env.gs.js +1 -1
- package/dist/gs/os/env.gs.js.map +1 -1
- package/dist/gs/os/error.gs.d.ts +1 -1
- package/dist/gs/os/error.gs.js +1 -1
- package/dist/gs/os/error.gs.js.map +1 -1
- package/dist/gs/os/exec.gs.d.ts +1 -1
- package/dist/gs/os/exec.gs.js +1 -1
- package/dist/gs/os/exec.gs.js.map +1 -1
- package/dist/gs/os/exec_posix.gs.d.ts +1 -1
- package/dist/gs/os/exec_posix.gs.js +1 -1
- package/dist/gs/os/exec_posix.gs.js.map +1 -1
- package/dist/gs/os/exec_unix.gs.d.ts +1 -1
- package/dist/gs/os/executable.gs.d.ts +1 -1
- package/dist/gs/os/executable_js.gs.d.ts +1 -1
- package/dist/gs/os/executable_wasm.gs.d.ts +1 -1
- package/dist/gs/os/file_constants_js.gs.d.ts +1 -1
- package/dist/gs/os/file_constants_js.gs.js +1 -1
- package/dist/gs/os/file_constants_js.gs.js.map +1 -1
- package/dist/gs/os/file_js.gs.d.ts +1 -1
- package/dist/gs/os/file_open_unix.gs.d.ts +1 -1
- package/dist/gs/os/file_posix_js.gs.d.ts +1 -1
- package/dist/gs/os/file_unix_js.gs.d.ts +1 -1
- package/dist/gs/os/getwd_js.gs.d.ts +1 -1
- package/dist/gs/os/path.gs.d.ts +1 -1
- package/dist/gs/os/path.gs.js +1 -1
- package/dist/gs/os/path.gs.js.map +1 -1
- package/dist/gs/os/path_unix.gs.js +1 -1
- package/dist/gs/os/path_unix.gs.js.map +1 -1
- package/dist/gs/os/pidfd_js.gs.d.ts +1 -1
- package/dist/gs/os/pipe_wasm.gs.d.ts +1 -1
- package/dist/gs/os/proc.gs.d.ts +1 -1
- package/dist/gs/os/proc.gs.js +1 -1
- package/dist/gs/os/proc.gs.js.map +1 -1
- package/dist/gs/os/proc_js.gs.d.ts +1 -1
- package/dist/gs/os/proc_js.gs.js +1 -1
- package/dist/gs/os/proc_js.gs.js.map +1 -1
- package/dist/gs/os/rawconn_js.gs.d.ts +1 -1
- package/dist/gs/os/removeall_js.gs.d.ts +1 -1
- package/dist/gs/os/root_js.gs.d.ts +1 -1
- package/dist/gs/os/root_js.gs.js +1 -1
- package/dist/gs/os/root_js.gs.js.map +1 -1
- package/dist/gs/os/root_nonwindows.gs.d.ts +1 -1
- package/dist/gs/os/root_noopenat.gs.d.ts +1 -1
- package/dist/gs/os/stat.gs.d.ts +1 -1
- package/dist/gs/os/stat_js.gs.d.ts +1 -1
- package/dist/gs/os/stat_unix_js.gs.d.ts +1 -1
- package/dist/gs/os/sys.gs.d.ts +1 -1
- package/dist/gs/os/sys_bsd.gs.d.ts +1 -1
- package/dist/gs/os/sys_js.gs.d.ts +1 -1
- package/dist/gs/os/tempfile.gs.d.ts +1 -1
- package/dist/gs/os/types.gs.d.ts +1 -1
- package/dist/gs/os/types.gs.js +1 -1
- package/dist/gs/os/types.gs.js.map +1 -1
- package/dist/gs/os/types_js.gs.d.ts +1 -1
- package/dist/gs/os/types_js.gs.js +1 -1
- package/dist/gs/os/types_js.gs.js.map +1 -1
- package/dist/gs/os/types_unix.gs.d.ts +1 -1
- package/dist/gs/os/types_unix.gs.js +1 -1
- package/dist/gs/os/types_unix.gs.js.map +1 -1
- package/dist/gs/os/zero_copy_posix.gs.d.ts +1 -1
- package/dist/gs/os/zero_copy_posix.gs.js +1 -1
- package/dist/gs/os/zero_copy_posix.gs.js.map +1 -1
- package/dist/gs/path/filepath/path.d.ts +11 -10
- package/dist/gs/path/filepath/path.js +5 -4
- package/dist/gs/path/filepath/path.js.map +1 -1
- package/dist/gs/path/match.d.ts +1 -1
- package/dist/gs/path/match.js +1 -1
- package/dist/gs/path/match.js.map +1 -1
- package/dist/gs/path/path.js +1 -1
- package/dist/gs/path/path.js.map +1 -1
- package/dist/gs/reflect/value.d.ts +1 -1
- package/dist/gs/reflect/value.js +1 -1
- package/dist/gs/reflect/value.js.map +1 -1
- package/dist/gs/reflect/visiblefields.d.ts +1 -1
- package/dist/gs/reflect/visiblefields.js +1 -1
- package/dist/gs/reflect/visiblefields.js.map +1 -1
- package/dist/gs/slices/slices.d.ts +1 -1
- package/dist/gs/slices/slices.js +1 -1
- package/dist/gs/slices/slices.js.map +1 -1
- package/dist/gs/sort/search.gs.d.ts +1 -1
- package/dist/gs/sort/search.gs.js +1 -1
- package/dist/gs/sort/search.gs.js.map +1 -1
- package/dist/gs/sort/slice.gs.d.ts +1 -1
- package/dist/gs/sort/slice.gs.js +1 -1
- package/dist/gs/sort/slice.gs.js.map +1 -1
- package/dist/gs/sort/sort.gs.d.ts +1 -1
- package/dist/gs/sort/sort.gs.js +1 -1
- package/dist/gs/sort/sort.gs.js.map +1 -1
- package/dist/gs/strconv/atob.gs.d.ts +1 -1
- package/dist/gs/strconv/atob.gs.js +1 -1
- package/dist/gs/strconv/atob.gs.js.map +1 -1
- package/dist/gs/strconv/atof.gs.d.ts +1 -1
- package/dist/gs/strconv/atoi.gs.d.ts +1 -1
- package/dist/gs/strconv/atoi.gs.js +5 -6
- package/dist/gs/strconv/atoi.gs.js.map +1 -1
- package/dist/gs/strconv/ftoa.gs.d.ts +1 -1
- package/dist/gs/strconv/ftoa.gs.js +1 -1
- package/dist/gs/strconv/ftoa.gs.js.map +1 -1
- package/dist/gs/strconv/itoa.gs.d.ts +1 -1
- package/dist/gs/strconv/itoa.gs.js +1 -1
- package/dist/gs/strconv/itoa.gs.js.map +1 -1
- package/dist/gs/strconv/quote.gs.d.ts +1 -1
- package/dist/gs/strconv/quote.gs.js +1 -1
- package/dist/gs/strconv/quote.gs.js.map +1 -1
- package/dist/gs/strings/builder.d.ts +1 -1
- package/dist/gs/strings/builder.js +1 -1
- package/dist/gs/strings/builder.js.map +1 -1
- package/dist/gs/strings/iter.js +1 -1
- package/dist/gs/strings/iter.js.map +1 -1
- package/dist/gs/strings/reader.d.ts +1 -1
- package/dist/gs/strings/reader.js +7 -8
- package/dist/gs/strings/reader.js.map +1 -1
- package/dist/gs/strings/replace.d.ts +1 -1
- package/dist/gs/strings/replace.js +1 -1
- package/dist/gs/strings/replace.js.map +1 -1
- package/dist/gs/strings/strings.d.ts +1 -1
- package/dist/gs/strings/strings.js +1 -1
- package/dist/gs/strings/strings.js.map +1 -1
- package/dist/gs/sync/atomic/doc.gs.d.ts +1 -1
- package/dist/gs/sync/atomic/doc_64.gs.d.ts +1 -1
- package/dist/gs/sync/atomic/type.gs.d.ts +1 -1
- package/dist/gs/sync/atomic/type.gs.js +1 -1
- package/dist/gs/sync/atomic/type.gs.js.map +1 -1
- package/dist/gs/sync/atomic/value.gs.d.ts +1 -1
- package/dist/gs/sync/atomic/value.gs.js +1 -1
- package/dist/gs/sync/atomic/value.gs.js.map +1 -1
- package/dist/gs/syscall/index.d.ts +1 -1
- package/dist/gs/syscall/index.js +1 -1
- package/dist/gs/syscall/index.js.map +1 -1
- package/dist/gs/unicode/utf8/utf8.d.ts +1 -1
- package/dist/gs/unicode/utf8/utf8.js +1 -1
- package/dist/gs/unicode/utf8/utf8.js.map +1 -1
- package/gs/builtin/builtin.ts +16 -64
- package/gs/builtin/errors.ts +25 -0
- package/gs/builtin/index.ts +7 -0
- package/gs/builtin/slice.ts +125 -70
- package/gs/bytes/buffer.gs.ts +1 -1
- package/gs/bytes/bytes.gs.ts +1 -1
- package/gs/bytes/iter.gs.ts +1 -1
- package/gs/bytes/reader.gs.ts +1 -1
- package/gs/context/context.ts +1 -1
- package/gs/errors/errors.ts +3 -16
- package/gs/github.com/pkg/errors/errors.ts +1 -1
- package/gs/github.com/pkg/errors/go113.ts +2 -2
- package/gs/github.com/pkg/errors/stack.ts +1 -1
- package/gs/internal/byteorder/index.ts +1 -1
- package/gs/internal/oserror/errors.ts +1 -1
- package/gs/io/fs/format.ts +1 -1
- package/gs/io/fs/fs.ts +1 -1
- package/gs/io/fs/glob.ts +1 -1
- package/gs/io/fs/readdir.ts +1 -1
- package/gs/io/fs/readfile.ts +1 -1
- package/gs/io/fs/stat.ts +1 -1
- package/gs/io/fs/sub.ts +1 -1
- package/gs/io/fs/walk.ts +1 -1
- package/gs/io/io.ts +1 -1
- package/gs/maps/iter.ts +1 -1
- package/gs/maps/maps.ts +1 -1
- package/gs/math/abs.gs.ts +1 -1
- package/gs/math/acosh.gs.ts +1 -1
- package/gs/math/asinh.gs.ts +1 -1
- package/gs/math/atan.gs.ts +1 -1
- package/gs/math/atan2.gs.ts +1 -1
- package/gs/math/atanh.gs.ts +1 -1
- package/gs/math/bits.gs.ts +1 -1
- package/gs/math/cbrt.gs.ts +1 -1
- package/gs/math/const.gs.ts +1 -1
- package/gs/math/copysign.gs.ts +1 -1
- package/gs/math/dim.gs.ts +1 -1
- package/gs/math/erf.gs.ts +1 -1
- package/gs/math/erfinv.gs.ts +1 -1
- package/gs/math/exp.gs.ts +1 -1
- package/gs/math/expm1.gs.ts +1 -1
- package/gs/math/floor.gs.ts +1 -1
- package/gs/math/frexp.gs.ts +1 -1
- package/gs/math/gamma.gs.ts +1 -1
- package/gs/math/hypot.gs.ts +1 -1
- package/gs/math/j0.gs.ts +1 -1
- package/gs/math/j1.gs.ts +1 -1
- package/gs/math/jn.gs.ts +1 -1
- package/gs/math/ldexp.gs.ts +1 -1
- package/gs/math/lgamma.gs.ts +1 -1
- package/gs/math/log.gs.ts +1 -1
- package/gs/math/log10.gs.ts +1 -1
- package/gs/math/log1p.gs.ts +1 -1
- package/gs/math/logb.gs.ts +1 -1
- package/gs/math/mod.gs.ts +1 -1
- package/gs/math/modf.gs.ts +1 -1
- package/gs/math/nextafter.gs.ts +1 -1
- package/gs/math/pow.gs.ts +1 -1
- package/gs/math/pow10.gs.ts +1 -1
- package/gs/math/remainder.gs.ts +1 -1
- package/gs/math/signbit.gs.ts +1 -1
- package/gs/math/sin.gs.ts +1 -1
- package/gs/math/sincos.gs.ts +1 -1
- package/gs/math/sinh.gs.ts +1 -1
- package/gs/math/sqrt.gs.ts +1 -1
- package/gs/math/tan.gs.ts +1 -1
- package/gs/math/tanh.gs.ts +1 -1
- package/gs/math/trig_reduce.gs.ts +1 -1
- package/gs/math/unsafe.gs.ts +1 -1
- package/gs/os/dir.gs.ts +1 -1
- package/gs/os/dir_unix.gs.ts +1 -1
- package/gs/os/dirent_js.gs.ts +1 -1
- package/gs/os/env.gs.ts +1 -1
- package/gs/os/error.gs.ts +1 -1
- package/gs/os/error_errno.gs.ts +1 -1
- package/gs/os/exec.gs.ts +1 -1
- package/gs/os/exec_nohandle.gs.ts +1 -1
- package/gs/os/exec_posix.gs.ts +1 -1
- package/gs/os/exec_unix.gs.ts +1 -1
- package/gs/os/executable.gs.ts +1 -1
- package/gs/os/executable_js.gs.ts +1 -1
- package/gs/os/executable_wasm.gs.ts +1 -1
- package/gs/os/file_constants_js.gs.ts +1 -1
- package/gs/os/file_js.gs.ts +1 -1
- package/gs/os/file_open_unix.gs.ts +1 -1
- package/gs/os/file_posix_js.gs.ts +1 -1
- package/gs/os/file_unix_js.gs.ts +1 -1
- package/gs/os/getwd_js.gs.ts +1 -1
- package/gs/os/path.gs.ts +1 -1
- package/gs/os/path_unix.gs.ts +1 -1
- package/gs/os/pidfd_js.gs.ts +1 -1
- package/gs/os/pipe_wasm.gs.ts +1 -1
- package/gs/os/proc.gs.ts +1 -1
- package/gs/os/proc_js.gs.ts +1 -1
- package/gs/os/rawconn_js.gs.ts +1 -1
- package/gs/os/removeall_js.gs.ts +1 -1
- package/gs/os/root_js.gs.ts +1 -1
- package/gs/os/root_nonwindows.gs.ts +1 -1
- package/gs/os/root_noopenat.gs.ts +1 -1
- package/gs/os/stat.gs.ts +1 -1
- package/gs/os/stat_js.gs.ts +1 -1
- package/gs/os/stat_unix_js.gs.ts +1 -1
- package/gs/os/sticky_bsd.gs.ts +1 -1
- package/gs/os/sys.gs.ts +1 -1
- package/gs/os/sys_bsd.gs.ts +1 -1
- package/gs/os/sys_js.gs.ts +1 -1
- package/gs/os/tempfile.gs.ts +1 -1
- package/gs/os/types.gs.ts +1 -1
- package/gs/os/types_js.gs.ts +1 -1
- package/gs/os/types_unix.gs.ts +1 -1
- package/gs/os/wait_unimp.gs.ts +1 -1
- package/gs/os/zero_copy_posix.gs.ts +1 -1
- package/gs/os/zero_copy_stub.gs.ts +1 -1
- package/gs/path/filepath/path.ts +14 -13
- package/gs/path/match.ts +1 -1
- package/gs/path/path.ts +1 -1
- package/gs/reflect/value.ts +1 -1
- package/gs/reflect/visiblefields.ts +1 -1
- package/gs/slices/slices.ts +1 -1
- package/gs/sort/search.gs.ts +1 -1
- package/gs/sort/slice.gs.ts +1 -1
- package/gs/sort/sort.gs.ts +1 -1
- package/gs/strconv/atob.gs.ts +1 -1
- package/gs/strconv/atof.gs.ts +1 -1
- package/gs/strconv/atoi.gs.ts +5 -6
- package/gs/strconv/doc.gs.ts +1 -1
- package/gs/strconv/ftoa.gs.ts +1 -1
- package/gs/strconv/itoa.gs.ts +1 -1
- package/gs/strconv/quote.gs.ts +1 -1
- package/gs/strings/builder.ts +1 -1
- package/gs/strings/iter.ts +1 -1
- package/gs/strings/reader.ts +7 -9
- package/gs/strings/replace.ts +1 -1
- package/gs/strings/strings.ts +1 -1
- package/gs/sync/atomic/doc.gs.ts +1 -1
- package/gs/sync/atomic/doc_64.gs.ts +1 -1
- package/gs/sync/atomic/type.gs.ts +1 -1
- package/gs/sync/atomic/value.gs.ts +1 -1
- package/gs/syscall/index.ts +1 -1
- package/gs/unicode/utf8/utf8.ts +1 -1
- package/package.json +3 -3
- package/gs/builtin/io.ts +0 -22
package/gs/reflect/value.ts
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
Invalid,
|
|
27
27
|
} from './type.js'
|
|
28
28
|
import { ReflectValue, SelectCase, SelectRecv, SelectDefault } from './types.js'
|
|
29
|
-
import * as $ from '@goscript/builtin/
|
|
29
|
+
import * as $ from '@goscript/builtin/index.js'
|
|
30
30
|
|
|
31
31
|
interface ChannelObject {
|
|
32
32
|
_sendQueue?: unknown[]
|
package/gs/slices/slices.ts
CHANGED
package/gs/sort/search.gs.ts
CHANGED
package/gs/sort/slice.gs.ts
CHANGED
package/gs/sort/sort.gs.ts
CHANGED
package/gs/strconv/atob.gs.ts
CHANGED
package/gs/strconv/atof.gs.ts
CHANGED
package/gs/strconv/atoi.gs.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as $ from "@goscript/builtin/
|
|
2
|
-
import * as errors from "@goscript/errors/index.js";
|
|
1
|
+
import * as $ from "@goscript/builtin/index.js";
|
|
3
2
|
|
|
4
|
-
export let ErrRange: $.GoError =
|
|
5
|
-
export let ErrSyntax: $.GoError =
|
|
3
|
+
export let ErrRange: $.GoError = $.newError("value out of range");
|
|
4
|
+
export let ErrSyntax: $.GoError = $.newError("invalid syntax");
|
|
6
5
|
|
|
7
6
|
export class NumError {
|
|
8
7
|
// the failing function (ParseBool, ParseInt, ParseUint, ParseFloat, ParseComplex)
|
|
@@ -82,11 +81,11 @@ export function rangeError(fn: string, str: string): NumError {
|
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
export function baseError(fn: string, str: string, base: number): NumError {
|
|
85
|
-
return new NumError({Func: fn, Num: str, Err:
|
|
84
|
+
return new NumError({Func: fn, Num: str, Err: $.newError("invalid base " + base)});
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
export function bitSizeError(fn: string, str: string, bitSize: number): NumError {
|
|
89
|
-
return new NumError({Func: fn, Num: str, Err:
|
|
88
|
+
return new NumError({Func: fn, Num: str, Err: $.newError("invalid bit size " + bitSize)});
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
export let IntSize: number = 64;
|
package/gs/strconv/doc.gs.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as $ from "@goscript/builtin/
|
|
1
|
+
import * as $ from "@goscript/builtin/index.js";
|
|
2
2
|
|
package/gs/strconv/ftoa.gs.ts
CHANGED
package/gs/strconv/itoa.gs.ts
CHANGED
package/gs/strconv/quote.gs.ts
CHANGED
package/gs/strings/builder.ts
CHANGED
package/gs/strings/iter.ts
CHANGED
package/gs/strings/reader.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import * as $ from '@goscript/builtin/
|
|
2
|
-
|
|
3
|
-
import * as errors from '@goscript/errors/index.js'
|
|
1
|
+
import * as $ from '@goscript/builtin/index.js'
|
|
4
2
|
|
|
5
3
|
import * as io from '@goscript/io/index.js'
|
|
6
4
|
|
|
@@ -90,7 +88,7 @@ export class Reader {
|
|
|
90
88
|
public ReadAt(b: Uint8Array, off: number): [number, $.GoError] {
|
|
91
89
|
const r = this
|
|
92
90
|
if (off < 0) {
|
|
93
|
-
return [0,
|
|
91
|
+
return [0, $.newError('strings.Reader.ReadAt: negative offset')]
|
|
94
92
|
}
|
|
95
93
|
if (off >= ($.len(r!.s) as number)) {
|
|
96
94
|
return [0, io.EOF]
|
|
@@ -119,7 +117,7 @@ export class Reader {
|
|
|
119
117
|
public UnreadByte(): $.GoError {
|
|
120
118
|
const r = this
|
|
121
119
|
if (r!.i <= 0) {
|
|
122
|
-
return
|
|
120
|
+
return $.newError('strings.Reader.UnreadByte: at beginning of string')
|
|
123
121
|
}
|
|
124
122
|
r!.prevRune = -1
|
|
125
123
|
r!.i--
|
|
@@ -151,10 +149,10 @@ export class Reader {
|
|
|
151
149
|
public UnreadRune(): $.GoError {
|
|
152
150
|
const r = this
|
|
153
151
|
if (r!.i <= 0) {
|
|
154
|
-
return
|
|
152
|
+
return $.newError('strings.Reader.UnreadRune: at beginning of string')
|
|
155
153
|
}
|
|
156
154
|
if (r!.prevRune < 0) {
|
|
157
|
-
return
|
|
155
|
+
return $.newError(
|
|
158
156
|
'strings.Reader.UnreadRune: previous operation was not ReadRune',
|
|
159
157
|
)
|
|
160
158
|
}
|
|
@@ -179,11 +177,11 @@ export class Reader {
|
|
|
179
177
|
abs = ($.len(r!.s) as number) + offset
|
|
180
178
|
break
|
|
181
179
|
default:
|
|
182
|
-
return [0,
|
|
180
|
+
return [0, $.newError('strings.Reader.Seek: invalid whence')]
|
|
183
181
|
break
|
|
184
182
|
}
|
|
185
183
|
if (abs < 0) {
|
|
186
|
-
return [0,
|
|
184
|
+
return [0, $.newError('strings.Reader.Seek: negative position')]
|
|
187
185
|
}
|
|
188
186
|
r!.i = abs
|
|
189
187
|
return [abs, null]
|
package/gs/strings/replace.ts
CHANGED
package/gs/strings/strings.ts
CHANGED
package/gs/sync/atomic/doc.gs.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as $ from "@goscript/builtin/
|
|
1
|
+
import * as $ from "@goscript/builtin/index.js";
|
|
2
2
|
import { AddInt32, AddUint32, AddUintptr, AndInt32, AndUint32, AndUintptr, CompareAndSwapInt32, CompareAndSwapPointer, CompareAndSwapUint32, CompareAndSwapUintptr, LoadInt32, LoadPointer, LoadUint32, LoadUintptr, OrInt32, OrUint32, OrUintptr, StoreInt32, StorePointer, StoreUint32, StoreUintptr, SwapInt32, SwapPointer, SwapUint32, SwapUintptr, uintptr } from "./doc.gs.js";
|
|
3
3
|
import { AddInt64, AddUint64, AndInt64, AndUint64, CompareAndSwapInt64, CompareAndSwapUint64, LoadInt64, LoadUint64, OrInt64, OrUint64, StoreInt64, StoreUint64, SwapInt64, SwapUint64 } from "./doc_64.gs.js";
|
|
4
4
|
|
package/gs/syscall/index.ts
CHANGED
package/gs/unicode/utf8/utf8.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Package utf8 implements functions and constants to support text encoded in UTF-8.
|
|
2
2
|
|
|
3
|
-
import * as $ from '@goscript/builtin/
|
|
3
|
+
import * as $ from '@goscript/builtin/index.js'
|
|
4
4
|
|
|
5
5
|
// RuneError is the "error" Rune or "Unicode replacement character"
|
|
6
6
|
export const RuneError = 0xfffd
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "goscript",
|
|
3
3
|
"description": "Go to TypeScript transpiler",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Aperture Robotics LLC.",
|
|
7
7
|
"email": "support@aperture.us",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"./gs/builtin": {
|
|
38
38
|
"import": {
|
|
39
|
-
"types": "./dist/gs/builtin/
|
|
40
|
-
"default": "./dist/gs/builtin/
|
|
39
|
+
"types": "./dist/gs/builtin/index.d.ts",
|
|
40
|
+
"default": "./dist/gs/builtin/index.js"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
},
|
package/gs/builtin/io.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Implementation of Go's built-in println function
|
|
3
|
-
* @param args Arguments to print
|
|
4
|
-
*/
|
|
5
|
-
export function println(...args: any[]): void {
|
|
6
|
-
console.log(...args)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Implementation of Go's built-in panic function
|
|
11
|
-
* @param args Arguments passed to panic
|
|
12
|
-
*/
|
|
13
|
-
export function panic(...args: any[]): void {
|
|
14
|
-
throw new Error(`panic: ${args.map((arg) => String(arg)).join(' ')}`)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Represents the Go error type (interface).
|
|
19
|
-
*/
|
|
20
|
-
export type GoError = {
|
|
21
|
-
Error(): string
|
|
22
|
-
} | null
|