File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ const walkerFilter = NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT;
14
14
15
15
const bindMap = new WeakMap ( ) ;
16
16
17
+ const extract = ( ctx ) => ( typeof ctx === 'function' ? ctx ( ) : ctx ) ;
18
+
17
19
export function createBind ( source , target , property , execution ) {
18
20
let propToTarget = bindMap . get ( source ) || bindMap . set ( source , { } ) . get ( source ) ;
19
21
if ( ! propToTarget [ property ] ) {
@@ -150,9 +152,9 @@ export function processDOM(scope, dom) {
150
152
const fn = directive . noExecution
151
153
? NOOP
152
154
: createFunction ( 'item' , `return ${ userCode } ` ) ;
153
- const update = ( altContext = context ) => {
155
+ const update = ( altContext = context ( ) ) => {
154
156
try {
155
- const value = fn . call ( scope , altContext ) ;
157
+ const value = fn . call ( scope , extract ( altContext ) ) ;
156
158
invocation ( value , isForcedUpdate ( scope ) ) ;
157
159
} catch ( err ) {
158
160
console . warn ( err ) ;
You can’t perform that action at this time.
0 commit comments