1064
Adobe’s Take:
Extracted methods are permanently bound to the object they are extracted from. Therefore, they can not later be called as a constructor. For example, the following creates function f() in Class A:
In the following code, extracting the function causes no error. However, creating a new instance of the function causes an error.
class A {
function f() {}
}In the following code, extracting the function causes no error. However, creating a new instance of the function causes an error.
var a = new A()
var m = a.f // extract f, don't call it
m() // same as a.f()
new m() // causes this error
Login/Register to make a post
· · ·

