'use strict' compatibility

Topics: Language Specification
Oct 4, 2012 at 12:51 PM

Currently if your TypeScript file contains classes that use inheritance, the TypeScript compiler emits the __extend function at the very top of the .js file.

 

This breaks strict-mode checking for the entire toplevel, forcing you to enable it in every closure instead.

 

I'd say the TypeScript language should check for the magic literal and keep it at the top line in the emitted javascript if present.

Oct 4, 2012 at 4:44 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Oct 4, 2012 at 4:45 PM

Great catch!  Thanks Sheeo.  I've copied this to a work item in the "Issue Tracker" as outlined above.