lundi 2 mars 2015

How to 'return' outside function definition in typescript




  1. I need to rewrite my tampermonkey script on typescript.




  2. What is correct way to rewrite this javascript on typescript?



    if (window.top != window.self ) {
    return;
    }



Main goal is to stop executing script if it's running not in window.top.


Typescript compiler write ERROR TS1108: A 'return' statement can only be used within a function body.





Aucun commentaire:

Enregistrer un commentaire