Microsoft JScript runtime error: Unable to get value of the property 'flags': object is null or undefined

Topics: General, Language Specification
Aug 30, 2013 at 6:25 PM
I'm using version 0.9.1.1 (latest as of writing). My Visual Studio project was failing to compile one TS file, but wasn't giving any errors either. Compiling it with the command line gave the error "Microsoft JScript runtime error: Unable to get value of the property 'flags': object is null or undefined".

I narrowed down the actual error in the file by trial and error and reduced it to:
function y(fun: () => void, val) {
    return val;
}

function x(val) {
    var val = y(function () {
        var e;
    }, val);
}
I know it doesn't look great but the unit tests weren't complaining.
The error goes away if I comment out the var declaration in function x:
function y(fun: () => void, val) {
    return val;
}

function x(val) {
    var val = y(function () {
        //var e;
    }, val);
}
Is this expected behaviour?
Sep 3, 2013 at 9:30 PM
I ran into the exact same compile error though I could never track down the exact line that caused the problem. I worked around it by replacing the .js files in C:\Program Files (x86)\Microsoft SDKs\TypeScript with ones downloaded from https://typescript.codeplex.com/SourceControl/latest#bin/tsc.js in the release-0.9.2 branch.

I think the release-0.9-2 branch might be a little more stable than develop. At least I had false compile errors with develop that I didn't get with release-0.9.2.
Coordinator
Sep 3, 2013 at 9:45 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.