Skip to content

Commit b308fa8

Browse files
author
perfmjs
committed
1.2.2 / 2014-07-16
================== * fixed: fixed scope problem in app.js
1 parent 64192f0 commit b308fa8

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

History.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.2.4 / 2014-07-16
2+
==================
3+
* fixed: fixed scope problem in app.js
4+
15
1.2.3 / 2014-07-16
26
==================
37
* fixed: add scope default vlaue in base.js

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
perfmjs-node
22
=======
3-
perfmjs(high performance javascript framework) for Node.js V1.2.3
3+
perfmjs(high performance javascript framework) for Node.js V1.2.4
44

55
Features:
66
=======

lib/perfmjs/app.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @date 2012-11-30
77
* import logger.js
88
* import eventProxy.js
9-
* import lazymodule.js
9+
* import base.js
1010
*/
1111
perfmjs.plugin('app', function($$) {
1212
$$.base("app", {
@@ -180,9 +180,7 @@ perfmjs.plugin('app', function($$) {
180180
if (module.instance != null){
181181
return module.instance;
182182
}
183-
var instance = new module.creator(false, opt), name, method;
184-
instance.init($$.eventProxy.newInstance());
185-
return instance;
183+
return module.creator.newInstance($$.eventProxy.newInstance(), opt);
186184
},
187185

188186
/**

lib/perfmjs/base.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
end: 0
1616
});
1717
$$.xxx.defaults = {
18-
scope: 'singleton',
1918
end: 0
2019
};
2120
});
2221
多级子类例子:
22+
if (typeof module !== 'undefined' && module.exports) {
23+
require('./xxx');
24+
}
2325
perfmjs.plugin('yyy', function($$) {
2426
$$.base("xxx.yyy", {
2527
init: function(initParam) {
@@ -28,7 +30,6 @@
2830
end: 0
2931
});
3032
$$.yyy.defaults = {
31-
scope: 'singleton',
3233
end: 0
3334
};
3435
});
@@ -64,11 +65,11 @@
6465
$$[name]['instance'] = this;
6566
}
6667
};
67-
$$[namespace][name].newInstance = function(initParam) {
68+
$$[namespace][name].newInstance = function(initParam, options) {
6869
if ($$[name]['instance']) {
6970
return $$[name]['instance'];
7071
}
71-
var _inst = new $$[namespace][name](false); _inst.init(initParam);
72+
var _inst = new $$[namespace][name](false, options); _inst.init(initParam);
7273
return _inst;
7374
};
7475
$$[namespace][name].prototype = $$.utils.extend(true, {}, parentPrototype, prototype);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "perfmjs-node",
33
"description":"perfmjs(high performance javascript framework) for Node.js",
44
"author": "tony",
5-
"version": "1.2.3",
5+
"version": "1.2.4",
66
"private": false,
77
"scripts": {
88
"start": "node start-server.js"

0 commit comments

Comments
 (0)