From 21c3bf8f0962c68044a89c2463863b027171da19 Mon Sep 17 00:00:00 2001 From: Dylan Schiemann Date: Thu, 15 Dec 2016 09:09:53 -0700 Subject: [PATCH] refs #18919, fix validity of function scope --- mvc/_atBindingMixin.js | 14 ++++++-------- mvc/sync.js | 16 +++++++--------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/mvc/_atBindingMixin.js b/mvc/_atBindingMixin.js index 639b99e8a1..200b7c9785 100644 --- a/mvc/_atBindingMixin.js +++ b/mvc/_atBindingMixin.js @@ -7,15 +7,13 @@ define([ "./resolve", "./sync" ], function(array, lang, declare, has, Stateful, resolve, sync){ - if(has("mvc-bindings-log-api")){ - function getLogContent(/*dojo/Stateful*/ target, /*String*/ targetProp){ + var getLogContent = (has("mvc-bindings-log-api")) ? function(/*dojo/Stateful*/ target, /*String*/ targetProp){ return [target._setIdAttr || !target.declaredClass ? target : target.declaredClass, targetProp].join(":"); - } + } : ""; - function logResolveFailure(target, targetProp){ + var logResolveFailure = (has("mvc-bindings-log-api")) ? function(target, targetProp){ console.warn(targetProp + " could not be resolved" + (typeof target == "string" ? (" with " + target) : "") + "."); - } - } + } : ""; function getParent(/*dijit/_WidgetBase*/ w){ // summary: @@ -232,8 +230,8 @@ define([ // summary: // Returns list of all properties that data binding is established with. - if(this._excludes){ - return this._excludes; // String[] + if(this._excludes){ + return this._excludes; // String[] } var list = []; for(var s in this._atWatchHandles){ diff --git a/mvc/sync.js b/mvc/sync.js index cfb73af132..dc8fb9d839 100644 --- a/mvc/sync.js +++ b/mvc/sync.js @@ -8,7 +8,7 @@ define([ /*===== mvc = {}; =====*/ - + /*===== dojox.mvc.sync.converter = { // summary: @@ -56,14 +56,12 @@ define([ var sync; - if(has("mvc-bindings-log-api")){ - function getLogContent(/*dojo/Stateful*/ source, /*String*/ sourceProp, /*dojo/Stateful*/ target, /*String*/ targetProp){ - return [ - [target.canConvertToLoggable || !target.declaredClass ? target : target.declaredClass, targetProp].join(":"), - [source.canConvertToLoggable || !source.declaredClass ? source : source.declaredClass, sourceProp].join(":") - ]; - } - } + var getLogContent = (has("mvc-bindings-log-api")) ? function(/*dojo/Stateful*/ source, /*String*/ sourceProp, /*dojo/Stateful*/ target, /*String*/ targetProp){ + return [ + [target.canConvertToLoggable || !target.declaredClass ? target : target.declaredClass, targetProp].join(":"), + [source.canConvertToLoggable || !source.declaredClass ? source : source.declaredClass, sourceProp].join(":") + ]; + } : ""; function equals(/*Anything*/ dst, /*Anything*/ src){ // summary: