Skip to content

Commit bfddd8f

Browse files
committed
Bug correction
1 parent 958673e commit bfddd8f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ js/sql-api.js: c/sqlite3.bc js/api.js
1919
$(EMSCRIPTEN)/emcc -s RESERVED_FUNCTION_POINTERS=2 $(CFLAGS) c/sqlite3.c --post-js js/api.js -o js/sql-api.js -s EXPORTED_FUNCTIONS=$(EXPORTED_FUNCTIONS)
2020

2121
js/api.js: js/api.coffee
22-
coffee -c js/api.coffee
22+
coffee -b -c js/api.coffee
2323

2424
c/sqlite3.bc: c/sqlite3.c
2525
# Generate llvm bitcode

js/api.coffee

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class Database
5050
#create a new one or open an existing database stored in the byte array passed in first argument
5151
constructor: (data) ->
5252
@filename = 'dbfile_' + (0xffffffff*Math.random()>>>0)
53-
if data then FS.createDataFile '/', filename, data, true, true
54-
ret = sqlite3_open filename, apiTemp
53+
if data? then FS.createDataFile '/', @filename, data, true, true
54+
ret = sqlite3_open @filename, apiTemp
5555
if ret isnt SQLite.OK then throw 'SQLite error: ' + SQLite.errorMessages[ret]
5656
@db = getValue(apiTemp, 'i32')
5757

@@ -81,10 +81,6 @@ class Database
8181
if pStmt is NULL then throw 'Nothing to prepare'
8282
return new Statement(pStmt)
8383

84-
85-
this['SQL'] = {'Database':Database}
86-
if exports? then exports = this['SQL']
87-
8884
getErrors = (ret, errPtrPtr) ->
8985
if ret isnt SQLite.OK
9086
return SQLite.errorMessages[ret]
@@ -179,3 +175,7 @@ SQLite.TEXT=3
179175
SQLite.BLOB=4
180176
SQLite.NULL=5
181177

178+
179+
# Export the API
180+
this['SQL'] = {'Database':Database}
181+
Module[i] = this['SQL'][i] for i of this['SQL']

0 commit comments

Comments
 (0)