typescript compiler ignoring define/import in 1 file -
I am suddenly having a very awkward collection of one of my files.
comm.ts:
import documents = required ('./documents / documents'); Import element = requirement ('./document / elements / element'); Import Paragraph = Required ('./documents / element / paragraph'); Import list body = requires ('. / Document / list-body'); // ... comm.js:
var __extends = this .__ extends || Function (D, B) {for (in var p) B (BHSOPPPERTI (P)) D [P] = B [P]; Function __ () {this.constructor = d; } __. Prototype = bprotype; D.prototype = new __ (); }; Define ("Required", "Export"), Function (Required, Export) {// ... What does the extension define with more important? Is 4 imports? They are used in code.
And the big problem is that when I run I receive an error:
SCRIPT5007: The property's 'prototype' Unable to obtain
with extension what
Typuscript prepares it for assistance with heritage, ie, the result will be expanded as a result of Class A Extended B . p> Why not drag into 4 imports? They are used in code.
I do not believe they are sure that you have something like this:
Import list body = requires ('. / document / list-body'); var foo = listBody; // Od will ensure mass Your error 'undefined or null reference com. JS property depicts this fact unable to get 'prototype'. What you are trying to not load (Generated is missing in Define) because typedcript thinks that it is not required on runtime.
Local Trial I have verified that the code generated by TypeScript is correct if it notifies extension < Em> foo.ts:
square foo {} export = Foo; bar.ts: import Foo = require ('. / Foo'); Class bar extends Foo {} compiled: tsc --module amd bar.ts Generate bar.js : var __extends = this .__ extended || Function (D, B) {for (in var p) B (BHSOPPPERTI (P)) D [P] = B [P]; Function __ () {this.constructor = d; } __. Prototype = bprotype; D.prototype = new __ (); }; Function (requirement, export, foo) {var Bar = (function (_super) {__extends (bar, _ super); define function bar (_super) (["requirement", "export", './foo '], Apply the function (this, argument);} return times;}) (foo);});
Comments
Post a Comment