@@ -53,7 +53,7 @@ function setupMethods (soljson) {
53
53
54
54
var wrapCallbackWithKind = function ( callback ) {
55
55
assert ( typeof callback === 'function' , 'Invalid callback specified.' ) ;
56
- return function ( kind , data , contents , error ) {
56
+ return function ( context , kind , data , contents , error ) {
57
57
var result = callback ( soljson . Pointer_stringify ( kind ) , soljson . Pointer_stringify ( data ) ) ;
58
58
if ( typeof result . contents === 'string' ) {
59
59
copyString ( result . contents , contents ) ;
@@ -117,6 +117,10 @@ function setupMethods (soljson) {
117
117
var output ;
118
118
try {
119
119
args . push ( cb ) ;
120
+ if ( isVersion6 ) {
121
+ // Callback context.
122
+ args . push ( null ) ;
123
+ }
120
124
output = compile . apply ( undefined , args ) ;
121
125
} catch ( e ) {
122
126
removeFunction ( cb ) ;
@@ -152,7 +156,12 @@ function setupMethods (soljson) {
152
156
} ;
153
157
}
154
158
if ( '_solidity_compile' in soljson ) {
155
- var solidityCompile = soljson . cwrap ( 'solidity_compile' , 'string' , [ 'string' , 'number' ] ) ;
159
+ var solidityCompile ;
160
+ if ( isVersion6 ) {
161
+ solidityCompile = soljson . cwrap ( 'solidity_compile' , 'string' , [ 'string' , 'number' , 'number' ] ) ;
162
+ } else {
163
+ solidityCompile = soljson . cwrap ( 'solidity_compile' , 'string' , [ 'string' , 'number' ] ) ;
164
+ }
156
165
compileStandard = function ( input , callbacks ) {
157
166
return runWithCallbacks ( callbacks , solidityCompile , [ input ] ) ;
158
167
} ;
0 commit comments