Fix the remoting method with the current receiver (this)
This commit is contained in:
parent
cab59eb61b
commit
1f965bfedb
12
lib/scope.js
12
lib/scope.js
|
@ -83,8 +83,8 @@ function defineScope(cls, targetClass, name, params, methods) {
|
|||
|
||||
// Wrap the property into a function for remoting
|
||||
var fn = function() {
|
||||
var f = this[name];
|
||||
f.apply(this, arguments);
|
||||
var f = cls[name];
|
||||
f.apply(cls, arguments);
|
||||
};
|
||||
|
||||
fn.shared = true;
|
||||
|
@ -96,8 +96,8 @@ function defineScope(cls, targetClass, name, params, methods) {
|
|||
cls['__get__' + name] = fn;
|
||||
|
||||
var fn_create = function() {
|
||||
var f = this[name].create;
|
||||
f.apply(this, arguments);
|
||||
var f = cls[name].create;
|
||||
f.apply(cls[name], arguments);
|
||||
};
|
||||
|
||||
fn_create.shared = true;
|
||||
|
@ -109,8 +109,8 @@ function defineScope(cls, targetClass, name, params, methods) {
|
|||
cls['__create__' + name] = fn_create;
|
||||
|
||||
var fn_delete = function() {
|
||||
var f = this[name].destroyAll;
|
||||
f.apply(this, arguments);
|
||||
var f = cls[name].destroyAll;
|
||||
f.apply(cls[name], arguments);
|
||||
};
|
||||
fn_delete.shared = true;
|
||||
fn_delete.http = {verb: 'delete', path: '/' + name};
|
||||
|
|
Loading…
Reference in New Issue