@@ -57,8 +57,6 @@ JavaScriptCompiler.prototype = {
5757 compile : function ( environment , options , context , asObject ) {
5858 this . environment = environment ;
5959 this . options = options ;
60- this . stringParams = this . options . stringParams ;
61- this . trackIds = this . options . trackIds ;
6260 this . precompile = ! asObject ;
6361
6462 this . name = this . environment . name ;
@@ -498,37 +496,7 @@ JavaScriptCompiler.prototype = {
498496 this . push ( [ this . aliasable ( 'container.lambda' ) , '(' , this . popStack ( ) , ', ' , this . contextName ( 0 ) , ')' ] ) ;
499497 } ,
500498
501- // [pushStringParam]
502- //
503- // On stack, before: ...
504- // On stack, after: string, currentContext, ...
505- //
506- // This opcode is designed for use in string mode, which
507- // provides the string value of a parameter along with its
508- // depth rather than resolving it immediately.
509- pushStringParam : function ( string , type ) {
510- this . pushContext ( ) ;
511- this . pushString ( type ) ;
512-
513- // If it's a subexpression, the string result
514- // will be pushed after this opcode.
515- if ( type !== 'SubExpression' ) {
516- if ( typeof string === 'string' ) {
517- this . pushString ( string ) ;
518- } else {
519- this . pushStackLiteral ( string ) ;
520- }
521- }
522- } ,
523-
524499 emptyHash : function ( omitEmpty ) {
525- if ( this . trackIds ) {
526- this . push ( '{}' ) ; // hashIds
527- }
528- if ( this . stringParams ) {
529- this . push ( '{}' ) ; // hashContexts
530- this . push ( '{}' ) ; // hashTypes
531- }
532500 this . pushStackLiteral ( omitEmpty ? 'undefined' : '{}' ) ;
533501 } ,
534502 pushHash : function ( ) {
@@ -541,14 +509,6 @@ JavaScriptCompiler.prototype = {
541509 let hash = this . hash ;
542510 this . hash = this . hashes . pop ( ) ;
543511
544- if ( this . trackIds ) {
545- this . push ( this . objectLiteral ( hash . ids ) ) ;
546- }
547- if ( this . stringParams ) {
548- this . push ( this . objectLiteral ( hash . contexts ) ) ;
549- this . push ( this . objectLiteral ( hash . types ) ) ;
550- }
551-
552512 this . push ( this . objectLiteral ( hash . values ) ) ;
553513 } ,
554514
@@ -727,44 +687,7 @@ JavaScriptCompiler.prototype = {
727687 //
728688 // Pops a value off the stack and assigns it to the current hash
729689 assignToHash : function ( key ) {
730- let value = this . popStack ( ) ,
731- context ,
732- type ,
733- id ;
734-
735- if ( this . trackIds ) {
736- id = this . popStack ( ) ;
737- }
738- if ( this . stringParams ) {
739- type = this . popStack ( ) ;
740- context = this . popStack ( ) ;
741- }
742-
743- let hash = this . hash ;
744- if ( context ) {
745- hash . contexts [ key ] = context ;
746- }
747- if ( type ) {
748- hash . types [ key ] = type ;
749- }
750- if ( id ) {
751- hash . ids [ key ] = id ;
752- }
753- hash . values [ key ] = value ;
754- } ,
755-
756- pushId : function ( type , name , child ) {
757- if ( type === 'BlockParam' ) {
758- this . pushStackLiteral (
759- 'blockParams[' + name [ 0 ] + '].path[' + name [ 1 ] + ']'
760- + ( child ? ' + ' + JSON . stringify ( '.' + child ) : '' ) ) ;
761- } else if ( type === 'PathExpression' ) {
762- this . pushString ( name ) ;
763- } else if ( type === 'SubExpression' ) {
764- this . pushStackLiteral ( 'true' ) ;
765- } else {
766- this . pushStackLiteral ( 'null' ) ;
767- }
690+ this . hash . values [ key ] = this . popStack ( ) ;
768691 } ,
769692
770693 // HELPERS
@@ -997,9 +920,6 @@ JavaScriptCompiler.prototype = {
997920
998921 setupParams : function ( helper , paramSize , params ) {
999922 let options = { } ,
1000- contexts = [ ] ,
1001- types = [ ] ,
1002- ids = [ ] ,
1003923 objectArgs = ! params ,
1004924 param ;
1005925
@@ -1010,14 +930,6 @@ JavaScriptCompiler.prototype = {
1010930 options . name = this . quotedString ( helper ) ;
1011931 options . hash = this . popStack ( ) ;
1012932
1013- if ( this . trackIds ) {
1014- options . hashIds = this . popStack ( ) ;
1015- }
1016- if ( this . stringParams ) {
1017- options . hashTypes = this . popStack ( ) ;
1018- options . hashContexts = this . popStack ( ) ;
1019- }
1020-
1021933 let inverse = this . popStack ( ) ,
1022934 program = this . popStack ( ) ;
1023935
@@ -1034,28 +946,12 @@ JavaScriptCompiler.prototype = {
1034946 while ( i -- ) {
1035947 param = this . popStack ( ) ;
1036948 params [ i ] = param ;
1037-
1038- if ( this . trackIds ) {
1039- ids [ i ] = this . popStack ( ) ;
1040- }
1041- if ( this . stringParams ) {
1042- types [ i ] = this . popStack ( ) ;
1043- contexts [ i ] = this . popStack ( ) ;
1044- }
1045949 }
1046950
1047951 if ( objectArgs ) {
1048952 options . args = this . source . generateArray ( params ) ;
1049953 }
1050954
1051- if ( this . trackIds ) {
1052- options . ids = this . source . generateArray ( ids ) ;
1053- }
1054- if ( this . stringParams ) {
1055- options . types = this . source . generateArray ( types ) ;
1056- options . contexts = this . source . generateArray ( contexts ) ;
1057- }
1058-
1059955 if ( this . options . data ) {
1060956 options . data = 'data' ;
1061957 }
0 commit comments