Próbálom referencia meglévő kódot használó Resig a „kiterjesztése”, de kapok egy csomó hibát
------ test.ts --------
/// <reference path=myclass.js />
var m = new MyClass (3);
------ myclass.js --------
/// <reference path=class.js />
var MyClass = Class.extend({
init: function (i)
{
this.i = i;
},
})
------ class.js --------
(copied from http://ejohn.org/blog/simple-javascript-inheritance/)
hibák:
Supplied parameters do not match any signature of call target
The name 'Class' does not exist in the current scope
The property 'extend' does not exist on value of type '() => void'
The name 'Class' does not exist in the current scope
Tisztában vagyok azzal, hogy végül én szeretnék átírni a kiterjesztése alapú kódot géppel, de addig, hogy hogyan tudom hivatkozik rá az új kódot?
Azt hiszem, ez felveti a mélyebb kérdés - miért nem panaszkodik típusú hibákat meglévő javascript kódot?













