File tree Expand file tree Collapse file tree 4 files changed +16
-3
lines changed
Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -531,7 +531,7 @@ export class LuaTransformer {
531531 ) ;
532532 const assignClassPrototypeConstructor = tstl . createAssignmentStatement (
533533 classPrototypeConstructor ,
534- className ,
534+ createClassNameWithExport ( ) ,
535535 statement
536536 ) ;
537537 result . push ( assignClassPrototypeConstructor ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ exports.TestClass = exports.TestClass or {};
33exports .TestClass .__index = exports .TestClass ;
44exports .TestClass .prototype = exports .TestClass .prototype or {};
55exports .TestClass .prototype .__index = exports .TestClass .prototype ;
6- exports .TestClass .prototype .constructor = TestClass ;
6+ exports .TestClass .prototype .constructor = exports . TestClass ;
77exports .TestClass .new = function (...)
88 local self = setmetatable ({}, exports .TestClass .prototype );
99 self :____constructor (... );
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ exports.TestClass = exports.TestClass or {};
33exports .TestClass .__index = exports .TestClass ;
44exports .TestClass .prototype = exports .TestClass .prototype or {};
55exports .TestClass .prototype .__index = exports .TestClass .prototype ;
6- exports .TestClass .prototype .constructor = TestClass ;
6+ exports .TestClass .prototype .constructor = exports . TestClass ;
77exports .TestClass .new = function (...)
88 local self = setmetatable ({}, exports .TestClass .prototype );
99 self :____constructor (... );
Original file line number Diff line number Diff line change @@ -133,4 +133,17 @@ export class TypeCheckingTests {
133133 "Cannot use instanceof on classes with decorator '@extension' or '@metaExtension'."
134134 ) ;
135135 }
136+
137+ @Test ( "instanceof export" )
138+ public instanceOfExport ( ) : void
139+ {
140+ const result = util . transpileExecuteAndReturnExport (
141+ `export class myClass {}
142+ let inst = new myClass();
143+ export const result = inst instanceof myClass;` ,
144+ "result"
145+ ) ;
146+
147+ Expect ( result ) . toBeTruthy ( ) ;
148+ }
136149}
You can’t perform that action at this time.
0 commit comments