@expressive/mvc 0.43.0 → 0.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -160,7 +160,7 @@ var Model = class _Model {
|
|
|
160
160
|
constructor(arg) {
|
|
161
161
|
const state = {};
|
|
162
162
|
let Type = this.constructor;
|
|
163
|
-
|
|
163
|
+
bindMethods(Type);
|
|
164
164
|
define(this, "is", { value: this });
|
|
165
165
|
STATE.set(this, state);
|
|
166
166
|
NAMES.set(this, typeof arg == "string" ? arg : `${Type}-${uid()}`);
|
|
@@ -372,26 +372,26 @@ function assign(to, values) {
|
|
|
372
372
|
if (applicable.has(key))
|
|
373
373
|
to[key] = values[key];
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function bindMethods(type) {
|
|
376
376
|
let keys = METHODS.get(type);
|
|
377
377
|
if (!keys) {
|
|
378
|
-
METHODS.set(type, keys =
|
|
378
|
+
METHODS.set(type, keys = bindMethods(Object.getPrototypeOf(type)).slice());
|
|
379
379
|
const desc = Object.getOwnPropertyDescriptors(type.prototype);
|
|
380
380
|
for (const key in desc)
|
|
381
381
|
if (key != "constructor" && "value" in desc[key]) {
|
|
382
|
-
let
|
|
382
|
+
let bind2 = function(method) {
|
|
383
383
|
const value2 = method.bind(this.is);
|
|
384
384
|
METHOD.set(value2, method);
|
|
385
385
|
define(this.is, key, { value: value2, writable: true });
|
|
386
386
|
return value2;
|
|
387
387
|
};
|
|
388
|
-
var
|
|
388
|
+
var bind = bind2;
|
|
389
389
|
let { value } = desc[key];
|
|
390
390
|
keys.push(key);
|
|
391
391
|
Object.defineProperty(type.prototype, key, {
|
|
392
|
-
set:
|
|
392
|
+
set: bind2,
|
|
393
393
|
get() {
|
|
394
|
-
return this.hasOwnProperty(key) ? value :
|
|
394
|
+
return this.hasOwnProperty(key) ? value : bind2.call(this, value);
|
|
395
395
|
}
|
|
396
396
|
});
|
|
397
397
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -126,7 +126,7 @@ var Model = class _Model {
|
|
|
126
126
|
constructor(arg) {
|
|
127
127
|
const state = {};
|
|
128
128
|
let Type = this.constructor;
|
|
129
|
-
|
|
129
|
+
bindMethods(Type);
|
|
130
130
|
define(this, "is", { value: this });
|
|
131
131
|
STATE.set(this, state);
|
|
132
132
|
NAMES.set(this, typeof arg == "string" ? arg : `${Type}-${uid()}`);
|
|
@@ -338,26 +338,26 @@ function assign(to, values) {
|
|
|
338
338
|
if (applicable.has(key))
|
|
339
339
|
to[key] = values[key];
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function bindMethods(type) {
|
|
342
342
|
let keys = METHODS.get(type);
|
|
343
343
|
if (!keys) {
|
|
344
|
-
METHODS.set(type, keys =
|
|
344
|
+
METHODS.set(type, keys = bindMethods(Object.getPrototypeOf(type)).slice());
|
|
345
345
|
const desc = Object.getOwnPropertyDescriptors(type.prototype);
|
|
346
346
|
for (const key in desc)
|
|
347
347
|
if (key != "constructor" && "value" in desc[key]) {
|
|
348
|
-
let
|
|
348
|
+
let bind2 = function(method) {
|
|
349
349
|
const value2 = method.bind(this.is);
|
|
350
350
|
METHOD.set(value2, method);
|
|
351
351
|
define(this.is, key, { value: value2, writable: true });
|
|
352
352
|
return value2;
|
|
353
353
|
};
|
|
354
|
-
var
|
|
354
|
+
var bind = bind2;
|
|
355
355
|
let { value } = desc[key];
|
|
356
356
|
keys.push(key);
|
|
357
357
|
Object.defineProperty(type.prototype, key, {
|
|
358
|
-
set:
|
|
358
|
+
set: bind2,
|
|
359
359
|
get() {
|
|
360
|
-
return this.hasOwnProperty(key) ? value :
|
|
360
|
+
return this.hasOwnProperty(key) ? value : bind2.call(this, value);
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
}
|
package/package.json
CHANGED