-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjUtils.js
More file actions
38 lines (33 loc) · 1.11 KB
/
ObjUtils.js
File metadata and controls
38 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Copyright (C) 2007 - 2014 Hyperweb2 All rights reserved.
* GNU General Public License version 3; see www.hyperweb2.com/terms/
*/
hwc.define([
'hwc!{PATH_JS_LIB}common/include.js'
], function () {
var $ = this;
$.ObjUtils = $.Class({members: [
{
a: ["public", "static"], n: "merge", v: function (obj1, obj2) {
var obj3 = {};
for (var attrname in obj1) {
obj3[attrname] = obj1[attrname];
}
for (var attrname in obj2) {
obj3[attrname] = obj2[attrname];
}
return obj3;
}
},
{
a: ["public","static"], n: "instanceFactory", v: function(cl,args) {
function dummy() {}
dummy.prototype = cl.prototype;
var obj = new dummy();
cl.apply(obj, args);
return obj;
}
}
]}
);
});