File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ cheers 🙌
117117 case '.config' :
118118 switch ( commandParts [ 1 ] ) {
119119 case 'set' : shell . setSetting ( commandParts [ 2 ] , convert ( commandParts [ 3 ] ) ) ; break ;
120- case 'del ' : delete shell . settings [ commandParts [ 2 ] ] ; break ;
120+ case 'unset ' : delete shell . settings [ commandParts [ 2 ] ] ; break ;
121121 default : return cb ( shell . settings ) ;
122122 } break ;
123123 case '.session' :
@@ -159,7 +159,6 @@ cheers 🙌
159159 return cb ( ) ;
160160 }
161161 return cb ( `${ c . bold ( c . yellow ( shell . blockchain . proc . pid ) ) } - ${ shell . blockchain . proc . spawnargs . join ( ', ' ) } ` )
162-
163162 default :
164163 console . error ( `Unknown Command: '${ command } '. Type '${ c . bold ( '.help' ) } ' for a list of commands.` ) ;
165164 }
@@ -171,7 +170,7 @@ cheers 🙌
171170
172171 /* REPL cmd */
173172 shell . run ( statement ) . then ( res => {
174- if ( typeof res === 'object' ) {
173+ if ( ! Array . isArray ( res ) && typeof res === 'object' ) {
175174 return cb ( ) ;
176175 }
177176 LAST_KNOWN_RESULT = res ;
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class SolidityStatement {
6060 this . scope = SCOPE . VERSION_PRAGMA ;
6161 this . hasNoReturnValue = true ;
6262 this . rawCommand = this . fixStatement ( this . rawCommand ) ;
63- } else if ( this . rawCommand . startsWith ( 'pragma ' ) ) {
63+ } else if ( this . rawCommand . startsWith ( 'pragma ' ) || this . rawCommand . startsWith ( 'import ' ) ) {
6464 this . scope = SCOPE . SOURCE_UNIT ;
6565 this . hasNoReturnValue = true ;
6666 this . rawCommand = this . fixStatement ( this . rawCommand ) ;
@@ -91,7 +91,7 @@ class SolidityStatement {
9191 }
9292
9393 fixStatement ( stm ) {
94- return stm . endsWith ( ';' ) ? stm : `${ stm } ;`
94+ return ( stm . endsWith ( ';' ) || stm . endsWith ( '}' ) ) ? stm : `${ stm } ;`
9595 }
9696
9797 toString ( ) {
@@ -287,13 +287,11 @@ contract ${this.settings.templateContractName} {
287287 let contractData = res . contracts [ '' ] ;
288288 contractData [ this . settings . templateContractName ] [ 'main' ] = this . settings . templateFuncMain ;
289289
290-
291290 this . blockchain . deploy ( contractData , ( err , retval ) => {
292291 if ( err ) {
293292 this . revert ( ) ;
294293 return reject ( err )
295294 }
296-
297295 return resolve ( retval ) // return value
298296 } )
299297 } ) . catch ( errors => {
@@ -426,5 +424,6 @@ class Blockchain {
426424
427425module . exports = {
428426 InteractiveSolidityShell,
429- SolidityStatement
427+ SolidityStatement,
428+ SCOPE
430429}
You can’t perform that action at this time.
0 commit comments