Skip to content

Commit

Permalink
FLUID-5800: Working test case for merging during exception - only wor…
Browse files Browse the repository at this point in the history
…king in standalone due to jQuery not being in strict mode!
  • Loading branch information
amb26 committed Nov 2, 2015
1 parent c9d974c commit 09e5cb7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/framework/core/js/Fluid.js
Expand Up @@ -1821,6 +1821,9 @@ var fluid = fluid || fluid_2_0_0;
// it has long been disused by DataBinding itself
fluid.model.mergeModel = function (target, source) {
if (fluid.isPlainObject(target)) {
if (source === fluid.NO_VALUE) {
console.log("NOW");
}
var copySource = fluid.copy(source);
$.extend(true, source, target);
$.extend(true, source, copySource);
Expand Down
2 changes: 1 addition & 1 deletion tests/framework-tests/core/html/FluidIoC-test.html
@@ -1,4 +1,4 @@
s<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Expand Down
25 changes: 25 additions & 0 deletions tests/framework-tests/core/js/FluidIoCTests.js
Expand Up @@ -701,6 +701,31 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
});
jqUnit.assertLeftHand("Merged grades in correct left-to-right order with direct grade arguments", expected, merged2.options);
});

fluid.defaults("fluid.tests.FLUID5800base", {
events: {
onUserToken: null
},
listeners: {
onUserToken: [{
priority: "first",
listener: "gpii.flowManager.setUserToken",
args: ["{that}", "{arguments}.0"]
}, "{that}.getPreferences"]
}
});

jqUnit.test("FLUID-5800 merge corruption", function () {
jqUnit.expect(1); // this used to throw on registration
fluid.defaults("fluid.tests.FLUID5800mid", {
gradeNames: "fluid.tests.FLUID5800base",
listeners: {
onUserToken: "{that}.getDeviceContext"
}
});
var def = fluid.defaults("fluid.tests.FLUID5800mid");
console.log(def);
});

/** Listener merging tests **/

Expand Down

0 comments on commit 09e5cb7

Please sign in to comment.