Skip to content

Commit 7be1d2a

Browse files
WebReflectionfelixfbecker
authored andcommitted
fix: pass right apply context (#100)
Reading the source code, I've noticed that: ```js (this.values || this.bind).push.apply(this.values, statement.values) ^ if this is falsy ^ so is this one ``` This fix makes the code not fail when `useBind` and `append` are used in the wild.
1 parent cc57fe7 commit 7be1d2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class SQLStatement {
2828
if (statement instanceof SQLStatement) {
2929
this.strings[this.strings.length - 1] += statement.strings[0]
3030
this.strings.push.apply(this.strings, statement.strings.slice(1))
31-
;(this.values || this.bind).push.apply(this.values, statement.values)
31+
const list = this.values || this.bind
32+
list.push.apply(list, statement.values)
3233
} else {
3334
this.strings[this.strings.length - 1] += statement
3435
}

0 commit comments

Comments
 (0)