mirror of
https://github.com/flynx/object.js.git
synced 2025-10-29 02:20:08 +00:00
minor tweak...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
41735e6380
commit
5654019be5
@ -1273,7 +1273,7 @@ Constructor('Mixin', {
|
||||
// This can be:
|
||||
// 'proto' - mix data into prototype chain (default)
|
||||
// 'flat' - use mixinFlat(..) to copy data
|
||||
// 'softflat' - like 'flat' but uses mixinFlat('soft', ..)
|
||||
// 'soft' - like 'flat' but uses mixinFlat('soft', ..)
|
||||
mode: 'proto',
|
||||
|
||||
// base API...
|
||||
@ -1289,7 +1289,7 @@ Constructor('Mixin', {
|
||||
&& ([_, mode, target] = arguments)
|
||||
return mode == 'flat' ?
|
||||
this.constructor.mixinFlat(target, this.data)
|
||||
: mode == 'softflat' ?
|
||||
: mode == 'soft' ?
|
||||
this.constructor.mixinFlat('soft', target, this.data)
|
||||
: this.constructor.mixin(target, this.data) },
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-object",
|
||||
"version": "5.4.10",
|
||||
"version": "5.4.11",
|
||||
"description": "",
|
||||
"main": "object.js",
|
||||
"scripts": {
|
||||
|
||||
2
test.js
2
test.js
@ -760,7 +760,7 @@ var cases = test.Cases({
|
||||
assert('b' in x == false, 'post-mixout content gone')
|
||||
assert('c' in x == false, 'post-mixout content gone')
|
||||
|
||||
var z = assert(C('softflat', {a:'zzz'}), `C("flat", {})`)
|
||||
var z = assert(C('soft', {a:'zzz'}), `C("flat", {})`)
|
||||
|
||||
assert(z.a == 'zzz', 'no overwrite')
|
||||
assert(z.b == 'bbb', 'mixin content from C')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user