Staram się odwoływać istniejący kod, który używa Resig na „przedłużyć”, ale jestem coraz kilka błędów
------ 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/)
błędy:
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
Zdaję sobie sprawę, że w końcu będę chcą przepisać kod przedłużyć do opartej na maszynopis, ale dopiero wtedy, jak mogę odwołać go z nowym kodem?
Chyba to nasuwa się głębsze pytanie - dlaczego jest ona narzeka błędów wpisać w istniejące kodu javascript?













