-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMeow_Base.js
222 lines (219 loc) · 6.69 KB
/
Meow_Base.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
var MeowBase = function() {
// Main Base
"use strict";
var Meow_Static;
var build = this;
var Meow_proto;
var Meow_Args = arguments;
var object;
var meowArray, Meow_array;
var Meow_Slice;
var Meow_Global;
var js, n;
var Meow_Base;
MeowBase.Meow_Base = function() {
Meow_Base.Meow_Extend = function(Meow_Instance) {
var Meow_Extend = Meow_Base.prototype.Meow_Extend;
Meow_Base.Meow_protoBuild = true;
var build = this;
var Build = build;
var Meow_proto = new Build();
Meow_Extend.call(Meow_proto, Meow_Instance);
Meow_proto.Meow_Base = function() {};
delete Meow_Base.Meow_protoBuild;
};
//var Meow_Construct = Meow_proto.Meow_Construct.valueOf();
var Meow_Construct = Meow_proto.Meow_Construct;
var Meow_Class = Meow_proto.Meow_Construct = function() {
if(!Meow_Base.Meow_protoBuild) {
if(build.Meow_protoConstruct || build.Meow_Construct === Meow_Class) {
build.Meow_protoConstruct = true;
Meow_Construct.apply(build, Meow_Args);
delete build.Meow_protoConstruct;
} else if(Meow_Args[0] !== null) {
return (Meow_Args[0].Meow_Extend || Meow_Extend).call(Meow_Args[0], Meow_proto);
}
}
};
Meow_Class.Meow_Ancester = build;
Meow_Class.Meow_Extend = build.Meow_Extend;
Meow_Class.Meow_forEach = build.Meow_forEach;
Meow_Class.Meow_implement = build.Meow_implement;
Meow_Class.prototype = Meow_proto;
Meow_Class.toString = build.toString;
Meow_Class.valueOf = function(Meow_Type) {
//return (Meow_Type === "object") ? Meow_Class : Meow_Construct;
return (Meow_Type === "object") ? Meow_Class : Meow_Construct.valueOf();
};
Meow_Extend.call(Meow_Class, Meow_Static);
if(typeof Meow_Class.Meow_Init === "function") {
Meow_Class.Meow_Init();
}
};
Meow_Base.prototype = {
Meow_Extend: function(Meow_Src, Meow_Val) {
if(Meow_Args.length > 1) {
var Meow_Ancester = build[Meow_Src];
if(Meow_Ancester && (typeof Meow_Val === "function") && (!Meow_Ancester.valueOf || Meow_Ancester.valueOf() !== Meow_Val.valueOf()) && /\bbase\b/.test(Meow_Val)) {
var Meow_Method = Meow_Val.valueOf();
Meow_Val = function() {
var Meow_Prev = build.Meow_base || Meow_Base.prototype.Meow_base;
build.Meow_base = Meow_Ancester;
var Meow_ReturnVal = Meow_Method.apply(build, Meow_Args);
build.Meow_base = Meow_Prev;
return Meow_ReturnVal;
};
Meow_Val.valueOf = function(Meow_Type) {
return (Meow_Type === "object") ? Meow_Val : Meow_Method;
};
Meow_Val.toString = Meow_Base.toString;
}
build[Meow_Src] = Meow_Val;
} else if(Meow_Src) {
var Meow_Extend = Meow_Base.prototype.Meow_Extend;
if(!Meow_Base.Meow_protoBuild && typeof build !== "function") {
Meow_Extend = build.Meow_Extend || Meow_Extend;
}
var Meow_proto = {
Meow_ToSrc: null
};
var Meow_Hidden = [
"Meow_Construct",
"toString",
"valueOf"
];
var m = Meow_Base.Meow_protoBuild ? 0 : 1;
var Meow_Key;
while(Meow_Key === Meow_Hidden[m++]) {
if(Meow_Src[Meow_Key] !== Meow_proto[Meow_Key]) {
Meow_Extend.call(build, Meow_Key, Meow_Src[Meow_Key]);
}
}
for(Meow_Key in Meow_Src) {
if(!Meow_proto[Meow_Key]) {
Meow_Extend.call(build, Meow_Key, Meow_Src[Meow_Key]);
}
}
}
return build;
}
};
Meow_Base = build.Meow_Extend({
Meow_Construct: function() {
build.Meow_Extend(Meow_Args[0]);
}
}, {
Meow_Ancester: object,
Meow_forEach: function(object, Meow_Block, Meow_Context) {
for(var Meow_Key in object) {
if(build.prototype[Meow_Key] === undefined) {
Meow_Block.call(Meow_Context, object[Meow_Key], Meow_Key, object);
}
}
},
Meow_implement: function() {
for(var m = 0; m < Meow_Args.length; m++) {
if(typeof Meow_Args[m] === "function") {
Meow_Args[m](build.prototype);
} else {
build.prototype.Meow_Extend(Meow_Args[m]);
}
}
return build;
},
toString: function() {
return String(build.valueOf());
}
});
// meowArray... Meow_Extend
var Meow_Extend = (Array.prototype, {
Meow_Shift: function() {
if (build.CallFunc) {
var m = 0;
while (m < build.length) {
build[m++] = build[m];
}
build.length--;
} else {
build.Meow_base();
}
},
Meow_UnShift: function() {
if (build.CallFunc) {
var length = Meow_Args.length;
var m = build.length += length;
while (m--) {
build[m] = m < length ? Meow_Args[m] : build[m - length];
}
} else {
build.Meow_base.apply(build, Meow_Args);
}
return build.length;
},
Meow_Combine: function(Meow_Key, Meow_Val) {
if (!Meow_Val) {
Meow_Val = Meow_Key;
}
return Meow_array.Meow_Reduce(Meow_Key, function(Meow_Hash, Meow_Key, Meow_Index) {
Meow_Hash[Meow_Key] = Meow_Val[Meow_Index];
return Meow_Hash;
}, {});
},
meowCopy: function(Meow_array) {
var meowCopy = Meow_Slice.call(Meow_array);
if(!meowCopy.Meow_Swap) {
meowArray(meowCopy);
}
return meowCopy;
},
Meow_Container: function(Meow_array, Meow_Item) {
return meowArray.indexOf(Meow_array, Meow_Item) !== -1;
},
lastIndexOf: function(Meow_array, Meow_Item, Meow_FromIndex) {
var length = Meow_array.length;
if(Meow_FromIndex === null) {
Meow_FromIndex = length - 1;
} else if(Meow_FromIndex < 0) {
Meow_FromIndex = Math.max(0, length + Meow_FromIndex);
}
for(var m = Meow_FromIndex; m >= 0; m--) {
if(Meow_array[m] === Meow_Item) {
return m;
}
}
return -1;
},
Meow_Remove: function(Meow_array, Meow_Item) {
var Meow_Index = meowArray.indexOf(Meow_array, Meow_Item);
if(Meow_Index !== -1) {
meowArray.removeAt(Meow_array, Meow_Index);
}
},
removeAt: function(Meow_array, Meow_Index) {
meowArray.splice(Meow_array, Meow_Index, 1);
},
Meow_Insert: function(Meow_array, Meow_Index, Meow_Item) {
meowArray.splice(Meow_array, Meow_Index, 0, Meow_Item);
},
Meow_Item: function(Meow_array, Meow_Index) {
if(Meow_Index < 0) {
Meow_Index += Meow_array.length;
}
return Meow_array[Meow_Index];
}
});
// Meow_Init
var Meow_Init = function() {
var Meow_Pkg = ['MeowPkg.js'];
var meowCopy;
Meow_Init = Meow_Global.Meow_Init = new Meow_Pkg(build, Meow_Init);
Meow_Init.toString = n("[Meow_Init]");
var exports = build.exports;
var MeowJS = new Meow_Pkg(build, MeowJS);
exports += build.exports;
js = new Meow_Pkg(build, js);
MeowJS.Meow_Extend = Meow_Extend;
Meow_Init.Javascript = meowCopy(js);
Meow_Init.Javascript.namespace += "Javascript is js";
};
};