Skip to content

Commit a58270c

Browse files
committed
Truckin
1 parent b090631 commit a58270c

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

bin/buildnum

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare -i MAJOR="0"
44
declare -i MINOR="2"
55
declare -i MINORMAX="99"
6-
declare -i REVISION="360"
6+
declare -i REVISION="383"
77
declare -i REVISIONMAX="999"
88

99
buildnum ()

core.js

-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ var echo = new Command('echo', '-E');
44
var print = new Command('echo', '-En');
55
//var printf = new Command('printf', '--');
66

7-
// exceptions will hurt you unless you develop an allocation stack to keep track of pointers
8-
// and catch those exceptions!
9-
107
var int = js.type.int;
118
var utf8p = js.type.utf8 | js.type.pointer;
129
var utf32p = js.type.utf32 | js.type.pointer;
@@ -31,5 +28,3 @@ printf("%ls\n", "Hello " + js.user.name);
3128
printf.parameters(utf8p);
3229
printf("%s\n", "Goodbye.");
3330

34-
exit(0);
35-

main.c

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ int main(int argc, char *argv[], char *envp[]) {
2626
while ((c = *script) && c != '\n') script++;
2727
}
2828
JSTScriptEval(script, NULL, argv[1], 1);
29+
JSGarbageCollect(ctx);
2930
} else { JSTScriptNativeError("unable to read user script: `%s'", argv[1]); }
3031

3132
if (e) JSTScriptReportException();

src/JSTools/Native.inc

+8-11
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ static JSTDeclareDeleteProperty(jsNativeContainerDelete) {
377377
static JSTDeclareGetProperty(jsNativeContainerGet) {
378378
static bool requestInProgress; if (requestInProgress) return NULL; else requestInProgress = true;
379379
JSTValue result = NULL;
380-
JSTObject get = (JSTObject) JSTObjectGetProperty(JSTObjectGetConstructor(object), "get");
381-
if (JSTObjectIsFunction(get)) result = JSTFunctionCall(get, object, JSTStringToValue(propertyName, false));
380+
JSTObject get = (JSTObject) JSTObjectGetProperty(JSTObjectGetProperty(JSTObjectGetPrototype(object), "constructor"), "get");
381+
if (JSTValueIsFunction(get)) result = JSTFunctionCall(get, object, JSTStringToValue(propertyName, false));
382382
requestInProgress = false; return (JSTValueIsNull(result))?NULL:result;
383383
}
384384

@@ -438,12 +438,9 @@ static JSTValue jsNativeContainer JSTDeclareFunction () {
438438
if (JSTObjectHasProperty(definition, "set")) jsClass.setProperty = &jsNativeContainerSet;
439439
if (JSTObjectHasProperty(definition, "enumerate")) jsClass.getPropertyNames = &jsNativeContainerEnumerate;
440440
if (JSTObjectHasProperty(definition, "query")) jsClass.hasProperty = &jsNativeContainerQuery;
441-
442-
// The underlying api doesn't work in coregtk-3.0
443-
// if (JSTObjectHasProperty(definition, "deallocate")) jsClass.finalize = &jsNativeContainerDeallocate;
444-
445-
JSTClass container = JSClassRetain(JSClassCreate(&jsClass)); free(name);
446-
return JSTValueFromPointer(container);
441+
//if (JSTObjectHasProperty(definition, "deallocate")) jsClass.finalize = &jsNativeContainerDeallocate;
442+
JSTValue r = JSTValueFromPointer(JSClassRetain(JSClassCreate(&jsClass))); free(name);
443+
return r;
447444

448445
}
449446

@@ -452,11 +449,11 @@ static JSTValue jsNativeInstance JSTDeclareFunction() {
452449
}
453450

454451
static JSTValue jsNativeSetPrototype JSTDeclareFunction() {
455-
JSTObjectSetPrototype((JSTObject)argv[1], argv[2]); return argv[2];
452+
JSTObjectSetPrototype((JSTObject)argv[0], argv[1]); return argv[1];
456453
}
457454

458455
static JSTValue jsNativeGetPrototype JSTDeclareFunction() {
459-
return (JSTValue) JSTObjectGetPrototype((JSTObject)argv[1]);
456+
return (JSTValue) JSTObjectGetPrototype((JSTObject)argv[0]);
460457
}
461458

462459
static JSTValue jsNativeSetPrivate JSTDeclareFunction() {
@@ -472,7 +469,7 @@ JSTObject JSTNativeInit_ JSTUtility(JSTObject js) {
472469
JSTObject lib = JSTClassInstance(NULL, NULL);
473470
JSTObjectSetProperty(native, "lib", lib, JSTObjectPropertyRequired);
474471

475-
char * jsNativeTypes = JSTConstructUTF8("js.signal = {fpe: %i, ill: %i, segv: %i, bus: %i, abrt: %i, iot: %i, trap: %i, sys: %i, term: %i, int: %i, quit: %i, kill: %i, hup: %i, alrm: %i, vtalrm: %i, prof: %i, io: %i, urg: %i, poll: %i, chld: %i, cld: %i, cont: %i, stop: %i, ttin: %i, ttou: %i, pipe: %i, xcpu: %i, xfsz: %i, usr1: %i, usr2: %i, winch: %i}js.native.alignment = %i; js.native.byteOrder = %i; js.call = {native: %i, ellipsis: %i, x86:{cdecl: %i, win32:{std:%i, fast:{ms: %i, gnu: %i}, 'this':{ms: %i, gnu: %i}}, plan9: %i}, x64:{win64: %i, sysv: %i}, ppc32:{darwin: %i, sysv: %i}, arm:{default: %i, thumb: %i, eabi:{default: %i, thumb: %i}}, mips32:{eabi: %i, o32: %i}, mips64:{n64: %i, n32: %i}}; Object.freeze(js.call); js.type = { 'void': %i, unsigned: %i, pointer: %i, ellipsis: %i, boolean: %i, char: %i, short: %i, int: %i, long: %i, int64: %i, float: %i, double: %i, size: %i, utf8: %i, utf16: %i, utf32: %i, struct: %i, union: %i, value: %i, string: %i};",
472+
char * jsNativeTypes = JSTConstructUTF8("js.signal = {fpe: %i, ill: %i, segv: %i, bus: %i, abrt: %i, iot: %i, trap: %i, sys: %i, term: %i, int: %i, quit: %i, kill: %i, hup: %i, alrm: %i, vtalrm: %i, prof: %i, io: %i, urg: %i, poll: %i, chld: %i, cld: %i, cont: %i, stop: %i, ttin: %i, ttou: %i, pipe: %i, xcpu: %i, xfsz: %i, usr1: %i, usr2: %i, winch: %i}; js.native.alignment = %i; js.native.byteOrder = %i; js.call = {native: %i, ellipsis: %i, x86:{cdecl: %i, win32:{std:%i, fast:{ms: %i, gnu: %i}, 'this':{ms: %i, gnu: %i}}, plan9: %i}, x64:{win64: %i, sysv: %i}, ppc32:{darwin: %i, sysv: %i}, arm:{default: %i, thumb: %i, eabi:{default: %i, thumb: %i}}, mips32:{eabi: %i, o32: %i}, mips64:{n64: %i, n32: %i}}; Object.freeze(js.call); js.type = { 'void': %i, unsigned: %i, pointer: %i, ellipsis: %i, boolean: %i, char: %i, short: %i, int: %i, long: %i, int64: %i, float: %i, double: %i, size: %i, utf8: %i, utf16: %i, utf32: %i, struct: %i, union: %i, value: %i, string: %i};",
476473
SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGABRT, SIGIOT, SIGTRAP, SIGSYS, SIGTERM, SIGINT, SIGQUIT, SIGKILL, SIGHUP, SIGALRM, SIGVTALRM, SIGPROF, SIGIO, SIGURG, SIGPOLL, SIGCHLD, SIGCLD, SIGCONT, SIGSTOP, SIGTTIN, SIGTTOU, SIGPIPE, SIGXCPU, SIGXFSZ, SIGUSR1, SIGUSR2, SIGWINCH,
477474
JSTNativeAlignment, JSTNativeByteOrder,
478475
0, DC_CALL_C_ELLIPSIS, DC_CALL_C_X86_CDECL, DC_CALL_C_X86_WIN32_STD,

0 commit comments

Comments
 (0)