Skip to content

Commit 9ef0a20

Browse files
committed
update scripts
1 parent ff283a0 commit 9ef0a20

File tree

3 files changed

+26
-29
lines changed

3 files changed

+26
-29
lines changed

src/component.js

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ function createClass(classId) {
720720
};
721721
this.id = new Function(
722722
'__proxy',
723-
'return function id () { return __proxy.call(this) };'
723+
'return function id () { return __proxy.apply(this) };'
724724
)(proxy);
725725

726726
// create link to db
@@ -746,7 +746,9 @@ function createClass(classId) {
746746
};
747747
return new Function(
748748
'__proxy',
749-
'return function ' + classId + ' (config) { __proxy.call(this,config) };'
749+
'return function ' +
750+
classId +
751+
' (config) { __proxy.apply(this, arguments) };'
750752
)(proxy);
751753
}
752754

@@ -763,7 +765,7 @@ function addIdClass(Class, classId) {
763765
};
764766
Class.id = new Function(
765767
'__proxy',
766-
'return function id () { return __proxy.call(this) };'
768+
'return function id () { return __proxy.apply(this) };'
767769
)(proxy);
768770
}
769771

@@ -1015,7 +1017,7 @@ function addProperties(model, Class, classId) {
10151017
'__proxy',
10161018
'return function ' +
10171019
propertyName +
1018-
' (position, value) { return __proxy.call(this, position, value) };'
1020+
' (position, value) { return __proxy.apply(this, arguments) };'
10191021
)(proxy);
10201022
} else {
10211023
proxy = function proxy(value) {
@@ -1138,7 +1140,7 @@ function addProperties(model, Class, classId) {
11381140
'__proxy',
11391141
'return function ' +
11401142
propertyName +
1141-
' (value) { return __proxy.call(this,value) };'
1143+
' (value) { return __proxy.apply(this, arguments) };'
11421144
)(proxy);
11431145
}
11441146
});
@@ -1317,7 +1319,7 @@ function addStructure(path, name, model, id) {
13171319
'__proxy',
13181320
'return function ' +
13191321
propertyName +
1320-
' (position, value) { return __proxy.call(this, position, value) };'
1322+
' (position, value) { return __proxy.apply(this, arguments) };'
13211323
)(proxy);
13221324
} else {
13231325
proxy = function proxy(value) {
@@ -1435,7 +1437,7 @@ function addStructure(path, name, model, id) {
14351437
'__proxy',
14361438
'return function ' +
14371439
propertyName +
1438-
' (value) { return __proxy.call(this,value) };'
1440+
' (value) { return __proxy.apply(this, arguments) };'
14391441
)(proxy);
14401442
}
14411443
});
@@ -1502,9 +1504,7 @@ function addMethods(model, Class, classId) {
15021504
methodName +
15031505
' (' +
15041506
params +
1505-
') { return __proxy.call(this,' +
1506-
params +
1507-
') };'
1507+
') { return __proxy.apply(this, arguments) };'
15081508
)(proxy);
15091509
if (methodName !== 'name') {
15101510
Class[methodName] = new Function(
@@ -1513,22 +1513,20 @@ function addMethods(model, Class, classId) {
15131513
methodName +
15141514
' (' +
15151515
paramsWithContext +
1516-
') { return __proxy.call(this,' +
1517-
paramsWithContext +
1518-
') };'
1516+
') { return __proxy.apply(this, arguments) };'
15191517
)(proxyWithContext);
15201518
}
15211519
} else {
15221520
Class.prototype[methodName] = new Function(
15231521
'__proxy',
1524-
'return function ' + methodName + ' () { return __proxy.call(this) };'
1522+
'return function ' + methodName + ' () { return __proxy.apply(this) };'
15251523
)(proxy);
15261524
if (methodName !== 'name') {
15271525
Class[methodName] = new Function(
15281526
'__proxy',
15291527
'return function ' +
15301528
methodName +
1531-
' (context) { return __proxy.call(this, context) };'
1529+
' (context) { return __proxy.apply(this, arguments) };'
15321530
)(proxyWithContext);
15331531
}
15341532
}
@@ -1602,14 +1600,12 @@ function addEvents(model, Class, classId) {
16021600
methodName +
16031601
' (' +
16041602
params +
1605-
') { return __proxy.call(this,' +
1606-
params +
1607-
') };'
1603+
') { return __proxy.apply(this, arguments) };'
16081604
)(proxy);
16091605
} else {
16101606
Class.prototype[methodName] = new Function(
16111607
'__proxy',
1612-
'return function ' + methodName + ' () { return __proxy.call(this) };'
1608+
'return function ' + methodName + ' () { return __proxy.apply(this) };'
16131609
)(proxy);
16141610
}
16151611
});
@@ -1689,7 +1685,7 @@ function addOn(Class, classId) {
16891685
};
16901686
Class.prototype.on = new Function(
16911687
'__proxy',
1692-
'return function on (state, action, useCoreAPI, isCore) { return __proxy.call(this, state, action, useCoreAPI, isCore) };'
1688+
'return function on (state, action, useCoreAPI, isCore) { return __proxy.apply(this, arguments) };'
16931689
)(proxy);
16941690
}
16951691

@@ -1766,7 +1762,7 @@ function addOnClass(Class, classId) {
17661762
};
17671763
Class.on = new Function(
17681764
'__proxy',
1769-
'return function on (state, action, useCoreAPI, isCore) { return __proxy.call(this, state, action, useCoreAPI, isCore) };'
1765+
'return function on (state, action, useCoreAPI, isCore) { return __proxy.apply(this, arguments) };'
17701766
)(proxy);
17711767
}
17721768

@@ -1799,7 +1795,7 @@ function addOffClass(Class, classId) {
17991795
};
18001796
Class.off = new Function(
18011797
'__proxy',
1802-
'return function off (state, behaviorId) { return __proxy.call(this, state, behaviorId) };'
1798+
'return function off (state, behaviorId) { return __proxy.apply(this, arguments) };'
18031799
)(proxy);
18041800
}
18051801

@@ -1843,7 +1839,7 @@ function addDestroyClass(Class) {
18431839
};
18441840
Class.destroy = new Function(
18451841
'__proxy',
1846-
'return function destroy () { return __proxy.call(this) };'
1842+
'return function destroy () { return __proxy.apply(this) };'
18471843
)(proxy);
18481844
}
18491845

@@ -1859,7 +1855,7 @@ function addRequireClass(Class) {
18591855
};
18601856
Class.require = new Function(
18611857
'__proxy',
1862-
'return function require (id) { return __proxy.call(this, id) };'
1858+
'return function require (id) { return __proxy.apply(this, arguments) };'
18631859
)(proxy);
18641860
}
18651861

@@ -1873,7 +1869,7 @@ function addInitClass(Class) {
18731869
var proxy = function proxy() {};
18741870
Class.init = new Function(
18751871
'__proxy',
1876-
'return function init (conf) { return __proxy.call(this, conf) };'
1872+
'return function init (conf) { return __proxy.apply(this, arguments) };'
18771873
)(proxy);
18781874
}
18791875

@@ -1889,7 +1885,7 @@ function addClassInfoClass(Class) {
18891885
};
18901886
Class.classInfo = new Function(
18911887
'__proxy',
1892-
'return function classInfo () { return __proxy.call(this) };'
1888+
'return function classInfo () { return __proxy.apply(this) };'
18931889
)(proxy);
18941890
}
18951891

src/helper.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ exports.isRuntime = function isRuntime() {
6060
exports.getRuntime = function getRuntime() {
6161
var runtimeId = '';
6262
var result = null;
63+
var search = $db._Runtime.find();
6364

64-
if (!runtimeRef) {
65-
runtimeId = $db._Runtime.find()[0]._id;
65+
if (!runtimeRef && search[0]) {
66+
runtimeId = search[0]._id;
6667
runtimeRef = $component.get(runtimeId);
6768
}
6869

tasks/concat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": {
44
"build/system/system.js": [
55
"src/banners/systemmodule-header.txt",
6-
"src/system/system-runtime.json",
6+
"build/system-runtime.json",
77
"src/banners/systemmodule-footer.txt"
88
]
99
}

0 commit comments

Comments
 (0)