Skip to content

Commit

Permalink
Minor update to standard library files, bump version from 1.8.0 to 1.…
Browse files Browse the repository at this point in the history
…9.0 in clox.ini and vcpkg.json files.
  • Loading branch information
HallofFamer committed Jul 28, 2024
1 parent f3cab28 commit 0a03dbd
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; ini file for configuration of clox virtual machine and environment variables

[basic] ; Basic configuration
version = 1.8.0 ; CLox version(do not change this)
version = 1.9.0 ; CLox version(do not change this)
script = ; default script file
path = ; default script path
timezone = America/New_York ; default timezone
Expand Down
1 change: 0 additions & 1 deletion src/std/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ LOX_METHOD(BinaryReadStream, readAsync) {
ObjFile* file = getFileProperty(vm, AS_INSTANCE(receiver), "file");
if (!file->isOpen) RETURN_PROMISE_EX(clox.std.io.IOException, "Cannot read the next byte because file is already closed.");
loadFileRead(vm, file);

ObjPromise* promise = fileReadAsync(vm, file, fileOnReadByte);
if (promise == NULL) RETURN_PROMISE_EX(clox.std.io.IOException, "Failed to read byte from IO stream.");
RETURN_OBJ(promise);
Expand Down
1 change: 1 addition & 0 deletions src/std/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ LOX_METHOD(HTTPClient, sendAsync) {
ASSERT_ARG_INSTANCE_OF("HTTPClient::send(request)", 0, clox.std.net.HTTPRequest);
ObjInstance* self = AS_INSTANCE(receiver);
ObjInstance* request = AS_INSTANCE(args[0]);

ObjString* url = AS_STRING(getObjProperty(vm, request, "url"));
HTTPMethod method = (HTTPMethod)AS_INT(getObjProperty(vm, request, "method"));
ObjDictionary* headers = AS_DICTIONARY(getObjProperty(vm, request, "headers"));
Expand Down
2 changes: 1 addition & 1 deletion src/std/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ LOX_METHOD(DurationClass, ofMinutes) {
ASSERT_ARG_TYPE("Duration class::ofMinutes(minutes)", 0, Int);
int minutes = AS_INT(args[0]);
if (minutes < 0) THROW_EXCEPTION_FMT(clox.std.lang.IllegalArgumentException, "method Duration class::ofMinutes(minutes) expects argument 1 to be a non negative integer but got %d.", minutes);

ObjClass* self = AS_CLASS(receiver);
ObjInstance* instance = newInstance(vm, self);

push(vm, OBJ_VAL(instance));
int duration[4] = { 0, 0, minutes, 0 };
durationObjInit(vm, duration, instance);
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clox",
"version": "1.8.0",
"version": "1.9.0",
"dependencies": [
"curl", "libuv"
]
Expand Down

0 comments on commit 0a03dbd

Please sign in to comment.