Skip to content

Commit 7373354

Browse files
committed
Add assertion that callback context is null
1 parent a96ff26 commit 7373354

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

wrapper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ function setupMethods (soljson) {
6161
var wrapCallbackWithKind = function (callback) {
6262
assert(typeof callback === 'function', 'Invalid callback specified.');
6363
return function (context, kind, data, contents, error) {
64+
// Must be a null pointer.
65+
assert(context === 0, 'Callback context must be null.');
6466
var result = callback(copyFromCString(kind), copyFromCString(data));
6567
if (typeof result.contents === 'string') {
6668
copyToCString(result.contents, contents);

0 commit comments

Comments
 (0)