mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
add buffer and byte objects, making socket read and write faster
This commit is contained in:
@@ -63,6 +63,12 @@ func makeGlobal() ArObject {
|
||||
}
|
||||
return nil, ArErr{TYPE: "TypeError", message: "Cannot convert '" + typeof(a[0]) + "' to hex", EXISTS: true}
|
||||
}}
|
||||
vars["buffer"] = builtinFunc{"buffer", func(a ...any) (any, ArErr) {
|
||||
if len(a) != 0 {
|
||||
return nil, ArErr{TYPE: "TypeError", message: "expected 0 arguments, got " + fmt.Sprint(len(a)), EXISTS: true}
|
||||
}
|
||||
return ArBuffer([]byte{}), ArErr{}
|
||||
}}
|
||||
vars["throwError"] = builtinFunc{"throwError", ArThrowError}
|
||||
vars["array"] = builtinFunc{"array", func(a ...any) (any, ArErr) {
|
||||
if len(a) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user