[Pkg-javascript-commits] [dojo] 03/149: Fix inconsistent handling of declare.safeMixin when second argument is undefined (throws error in IE8, no-op in other browsers), which fixes
David Prévot
taffit at moszumanska.debian.org
Sat Feb 27 03:13:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository dojo.
commit b23d243b5284f168ef08756044c6c26bab7c0ab9
Author: Kris Zyp <kriszyp at gmail.com>
Date: Tue Jun 24 10:06:17 2014 -0600
Fix inconsistent handling of declare.safeMixin when second argument is
undefined (throws error in IE8, no-op in other browsers), which fixes
---
_base/declare.js | 2 +-
tests/_base/declare.js | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/_base/declare.js b/_base/declare.js
index 56086fe..08fd137 100644
--- a/_base/declare.js
+++ b/_base/declare.js
@@ -305,7 +305,7 @@ define(["./kernel", "../has", "./lang"], function(dojo, has, lang){
target[name] = t;
}
}
- if(has("bug-for-in-skips-shadowed")){
+ if(has("bug-for-in-skips-shadowed") && source){
for(var extraNames= lang._extraNames, i= extraNames.length; i;){
name = extraNames[--i];
t = source[name];
diff --git a/tests/_base/declare.js b/tests/_base/declare.js
index ce1776c..140f7b3 100644
--- a/tests/_base/declare.js
+++ b/tests/_base/declare.js
@@ -511,6 +511,29 @@ define([
t.is("blah", d3.foo);
t.is("thonk", d4.foo);
t.is("thonk", d5.bar);
+ },
+
+ function safeMixin(t){
+ var fooCalled;
+ var subFooCalled;
+ var C = declare(null, {
+ foo: function(){
+ fooCalled = true;
+ }
+ });
+ var c = new C();
+ // make sure we can mixin foo
+ declare.safeMixin(c, {
+ foo: function(){
+ subFooCalled = true;
+ this.inherited(arguments);
+ }
+ });
+ // make sure this doesn't throw an error
+ declare.safeMixin(c);
+ c.foo();
+ t.t(fooCalled);
+ t.t(subFooCalled);
}
// FIXME: there are still some permutations to test like:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git
More information about the Pkg-javascript-commits
mailing list