@@ -52,8 +52,8 @@ class Duck extends Function {
52
52
gf = arg [ fns [ i ] ]
53
53
if ( ! gf ||
54
54
( gf . hasMethod
55
- ? ! gf . hasMethod . apply ( gf , args )
56
- : typeof gf === 'function' ) ) {
55
+ ? ! gf . hasMethod . apply ( gf , args )
56
+ : typeof gf === 'function' ) ) {
57
57
return false
58
58
}
59
59
}
@@ -81,7 +81,7 @@ Duck.prototype.isProtocol = true
81
81
const Protoduck = module . exports = define ( [ 'duck' ] , {
82
82
createGenfun : [ 'duck' , _metaCreateGenfun ] ,
83
83
addMethod : [ 'duck' , _metaAddMethod ]
84
- } , { name : 'Protoduck' } )
84
+ } , { name : 'Protoduck' } )
85
85
86
86
const noImplFound = module . exports . noImplFound = genfun . noApplicableMethod
87
87
@@ -168,22 +168,22 @@ function defineMethod (duck, name, target, types, impls) {
168
168
if ( ! Object . prototype . hasOwnProperty . call ( target , name ) ) {
169
169
// Make a genfun if there's nothing there
170
170
const gf = useMetaobject
171
- ? duck . _metaobject . createGenfun ( duck , target , name , null )
172
- : _metaCreateGenfun ( duck , target , name , null )
171
+ ? duck . _metaobject . createGenfun ( duck , target , name , null )
172
+ : _metaCreateGenfun ( duck , target , name , null )
173
173
target [ name ] = gf
174
174
} else if ( typeof target [ name ] === 'function' && ! target [ name ] . isGenfun ) {
175
175
// Turn non-gf functions into genfuns
176
176
const gf = useMetaobject
177
- ? duck . _metaobject . createGenfun ( duck , target , name , target [ name ] )
178
- : _metaCreateGenfun ( duck , target , name , target [ name ] )
177
+ ? duck . _metaobject . createGenfun ( duck , target , name , target [ name ] )
178
+ : _metaCreateGenfun ( duck , target , name , target [ name ] )
179
179
target [ name ] = gf
180
180
}
181
181
182
182
const fn = impls [ name ] || duck . _defaultImpls [ name ]
183
183
if ( fn ) { // checkImpls made sure this is safe
184
184
useMetaobject
185
- ? duck . _metaobject . addMethod ( duck , target , name , methodTypes , fn )
186
- : _metaAddMethod ( duck , target , name , methodTypes , fn )
185
+ ? duck . _metaobject . addMethod ( duck , target , name , methodTypes , fn )
186
+ : _metaAddMethod ( duck , target , name , methodTypes , fn )
187
187
}
188
188
}
189
189
@@ -256,8 +256,8 @@ function installMethodErrorMessage (proto, gf, target, name) {
256
256
proto . name ? `${ proto . name } #` : ''
257
257
} ${ name } (${ [ ] . map . call ( args , typeName ) . join ( ', ' ) } ). You must implement ${
258
258
proto . name
259
- ? formatMethod ( proto , name , true )
260
- : `the protocol ${ formatMethod ( proto , name ) } belongs to`
259
+ ? formatMethod ( proto , name , true )
260
+ : `the protocol ${ formatMethod ( proto , name ) } belongs to`
261
261
} in order to call ${ typeName ( thisArg ) } #${ name } (${
262
262
[ ] . map . call ( args , typeName ) . join ( ', ' )
263
263
} ).`
@@ -330,8 +330,8 @@ class Constraint {
330
330
const thisType = (
331
331
this . thisIdx === 'this' || this . thisIdx == null
332
332
)
333
- ? target
334
- : types [ this . thisIdx ]
333
+ ? target
334
+ : types [ this . thisIdx ]
335
335
const parentTypes = this . indices . map ( idx => {
336
336
if ( idx === 'this' ) {
337
337
return target
0 commit comments