I apologize for the potentially problematic inquiry.
Issue:
Here is the TypeScript class definition:
1 class MyClass {
2 constructor() {
3 alert("MyClass instantiated!");
4 }
5 }
6 export = MyClass;
After compilation, it becomes JavaScript like this:
1 var MyClass = (function () {
2 function MyClass() {
3 var _this = this;
4 alert("MyClass instantiated!");
5 }
6 }
7 module.exports = MyClass
The class is referenced in a JSP page that contains this script:
<script language='javascript' src="myclass.js">
var myclass = new MyClass();
</script>
Upon debugging, it's observed that the code reaches line 1 of the compiled JavaScript file but exits at line number 7.
Inquiry:
Why does the execution not enter the function and rather exits? Could there be an issue with how I'm instantiating it?