Navigation Menu

Skip to content

Commit

Permalink
FLUID-5762: Helpful diagnostic on faulty priority
Browse files Browse the repository at this point in the history
  • Loading branch information
amb26 committed Sep 11, 2015
1 parent a1e3d60 commit 590dc58
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/framework/core/js/Fluid.js
Expand Up @@ -1122,7 +1122,7 @@ var fluid = fluid || fluid_2_0;
var type = segs[0];
var lookup = fluid.priorityTypes[type];
if (lookup === undefined) {
fluid.fail("Invalid priority constraint type in constraint " + constraint + ": the only supported values are " + fluid.keys(fluid.priorityType).join(", "));
fluid.fail("Invalid priority constraint type in constraint " + constraint + ": the only supported values are " + fluid.keys(fluid.priorityTypes).join(", ") + " or numeric");
}
if (fixedOnly && lookup === 0) {
fluid.fail("Constraint-based priority in constraint " + constraint + " is not supported in a " + site + " record - you must use either a numeric value or first, last");
Expand Down
19 changes: 19 additions & 0 deletions tests/framework-tests/core/js/FluidIoCTests.js
Expand Up @@ -2049,6 +2049,25 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
jqUnit.assertDeepEq("Children constructed in sort order", [1, 2, 3, 4], testComp.constructRecord);
});

fluid.defaults("fluid.tests.FLUID5762test", {
gradeNames: "fluid.component",
events: {
thing: null
},
listeners: {
thing: {
funcName: "fluid.identity",
priority: "10"
}
}
});

jqUnit.test("FLUID-5762: Helpful diagnostic on faulty priority", function () {
jqUnit.expectFrameworkDiagnostic("Got framework diagnostic from faulty priority", function () {
fluid.tests.FLUID5762test();
}, ["last", "numeric"]);
});

/** Tree circularity tests (early detection of stack overflow) **/

fluid.defaults("fluid.tests.circularEvent", {
Expand Down

0 comments on commit 590dc58

Please sign in to comment.