@@ -6043,7 +6043,7 @@ export class Compiler extends DiagnosticEmitter {
6043
6043
switch ( target . kind ) {
6044
6044
case ElementKind . LOCAL : {
6045
6045
let local = < Local > target ;
6046
- if ( local . closureContextOffset ) {
6046
+ if ( local . closureContextOffset >= 0 ) {
6047
6047
// TODO: ability to update closed over locals
6048
6048
this . error (
6049
6049
DiagnosticCode . Not_implemented ,
@@ -6444,7 +6444,7 @@ export class Compiler extends DiagnosticEmitter {
6444
6444
module . local_get ( closureContextLocal . index , this . options . nativeSizeType ) ,
6445
6445
module . local_get ( local . index , nativeType ) ,
6446
6446
nativeType ,
6447
- assert ( local . closureContextOffset )
6447
+ assert ( local . closureContextOffset >= 0 )
6448
6448
) ;
6449
6449
}
6450
6450
return module . block ( null , exprs ) ;
@@ -6687,6 +6687,7 @@ export class Compiler extends DiagnosticEmitter {
6687
6687
// Once we get here, we have a function reference. With the new scheme, this function
6688
6688
// could possibly be a closure. So here we check to see if it's a closure, then apply
6689
6689
// the appropriate call logic
6690
+ signature = assert ( signature ) // FIXME: asc can't see this yet
6690
6691
var returnType = signature . returnType ;
6691
6692
var tempFunctionReferenceLocal = this . currentFlow . getTempLocal ( this . options . usizeType ) ;
6692
6693
var usize = this . options . nativeSizeType ;
@@ -6695,7 +6696,7 @@ export class Compiler extends DiagnosticEmitter {
6695
6696
this . ifClosure (
6696
6697
module . local_get ( tempFunctionReferenceLocal . index , usize ) ,
6697
6698
this . compileCallIndirect ( // If this is a closure
6698
- assert ( signature ) . toClosureSignature ( ) , // FIXME: asc can't see this yet
6699
+ signature . toClosureSignature ( ) ,
6699
6700
module . block ( null , [
6700
6701
module . load (
6701
6702
4 ,
@@ -6715,7 +6716,7 @@ export class Compiler extends DiagnosticEmitter {
6715
6716
contextualType == Type . void
6716
6717
) ,
6717
6718
this . compileCallIndirect ( // If this function isn't a closure
6718
- assert ( signature ) , // FIXME: asc can't see this yet
6719
+ signature ,
6719
6720
module . local_get ( tempFunctionReferenceLocal . index , usize ) ,
6720
6721
expression . args ,
6721
6722
expression ,
@@ -8448,7 +8449,7 @@ export class Compiler extends DiagnosticEmitter {
8448
8449
let localType = local . type ;
8449
8450
assert ( localType != Type . void ) ;
8450
8451
var localClosureContextOffset = local . closureContextOffset ;
8451
- if ( localClosureContextOffset !== null ) {
8452
+ if ( localClosureContextOffset >= 0 ) {
8452
8453
let contextLocal = assert ( flow . lookupLocal ( CommonNames . this_ ) ) ;
8453
8454
8454
8455
// TODO: replace this with a class field access, once we are able to construct the class before
0 commit comments