Closed bluePlayer closed 7 years ago
The Original source files are made in TypeScript. This little piece of code here is created by the compiler, and used for inheritance.
Ideally you shouldn't Lint compiled libraries in your project. I do however think that Linting is an important process and therefor we have added TSlint in this library, so we can still lint the original sources.
You are using the official Typescript compiler? And this compiler converts to JS with fake inheritance? :D Dear God, JS does not have classical inheritance. And also the other part of the library contains rather bad JavaScript, no offence.
You're always welcome to submit a PR if you think there are some improvements needed, nothing is set stone.
Was about to rework the JS code completely with JS best practices. Seems like a promising library. Once I find time and enthusiasm will do so... :)
You can rework the compiled JS files but those will be overwritten everytime we recompile the stuff. You can also apply most of those practices to the TypeScript source as well, TS runs regular JavaScript as well. Maybe I should start adding contributing guide's to explain the current development process :)
Yes I know that Typescript compiler can understand JS but didn't know that this compiler cannot create good JS code, sadly.
You're making me curious about which parts of the compiled code are actually so wrong that they annoy you :P
It doesn't annoy me. I would just fix the code above and go with it(if I knew how). But the whole script is based on classical inheritance which doesn't exist in JS and I also see, using the "this" keyword, million times. :) Hard to read.
Using the "var" keyword multiple times in a single function block. No need for that.
Function inside a function, inside a function. No need for such nesting. There can be only one function which creates one library object in the DOM. ;)
Try run the non minimized version in Aptana3/JSlint, you will see red lines but also lot of warnings. ;)
Perhaps there are some options to choose in the Typescript compiler. Is it compiling with strict mode on?
I copied the non minimized version of the script in Aptana Studio 3 and turned on JSlint. I cannot execute my other code since this script breaks before it.
What did the author wanted to achieve with this code block: