@@ -18,6 +18,7 @@ var SELF_COMPILE_OPTIONS = {
1818
1919var needsReload = true ;
2020var oldSystemGet = System . get ;
21+ var currentOptions ;
2122
2223exports . reloadSources = function ( ) {
2324 needsReload = true ;
@@ -43,10 +44,12 @@ exports.compile = function compile(options, paths, source, reloadTraceur) {
4344 var CompilerCls = System . get ( 'transpiler/src/compiler' ) . Compiler ;
4445
4546 var compiler = new CompilerCls ( options , moduleName ) ;
47+ currentOptions = options ;
4648 var result = {
4749 js : compiler . compile ( source , inputPath , outputPath ) ,
4850 sourceMap : null
4951 } ;
52+ currentOptions = null ;
5053
5154 var sourceMapString = compiler . getSourceMap ( ) ;
5255 if ( sourceMapString ) {
@@ -186,6 +189,7 @@ function useRttsAssertModuleForConvertingTypesToExpressions() {
186189 for ( var prop in patch . prototype ) {
187190 original . prototype [ prop ] = patch . prototype [ prop ] ;
188191 }
192+ original . prototype . getOptions = function ( ) { return currentOptions ; } ;
189193
190194 var TypeAssertionTransformer = System . get ( traceurVersion + '/src/codegeneration/TypeAssertionTransformer' ) . TypeAssertionTransformer ;
191195 var createIdentifierExpression = System . get ( traceurVersion + '/src/codegeneration/ParseTreeFactory' ) . createIdentifierExpression ;
@@ -197,7 +201,8 @@ function useRttsAssertModuleForConvertingTypesToExpressions() {
197201 this . paramTypes_ . atLeastOneParameterTyped = true ;
198202 } else {
199203 // PATCH start
200- typeAnnotation = parseExpression ( [ "assert.type.any" ] ) ;
204+ var typeModule = currentOptions . outputLanguage === 'es6' ? 'assert' : '$traceurRuntime' ;
205+ typeAnnotation = parseExpression ( [ typeModule + ".type.any" ] ) ;
201206 // PATCH end
202207 }
203208
0 commit comments