can-route
Advanced tools
Comparing version 4.3.4 to 4.3.5
@@ -356,3 +356,4 @@ "use strict"; | ||
map.attr = function(prop, val) { | ||
var serializable = this.define === undefined || this.define[prop] === undefined || !!this.define[prop].serialize, | ||
var serializable = typeof prop === "string" && | ||
(this.define === undefined || this.define[prop] === undefined || !!this.define[prop].serialize), | ||
args; | ||
@@ -359,0 +360,0 @@ |
{ | ||
"name": "can-route", | ||
"version": "4.3.4", | ||
"version": "4.3.5", | ||
"description": "Observable front-end application routing for CanJS.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://canjs.com/doc/can-route.html", |
@@ -410,3 +410,30 @@ /* jshint asi:true */ | ||
test("Calling attr with an object should not stringify object (#197)", function () { | ||
setupRouteTest(function (iframe, iCanRoute, loc, win) { | ||
var app = new win.CanMap({}); | ||
app.define = { foo: { serialize: false } }; | ||
app.attr('foo', true); | ||
equal(app.attr('foo'), true, 'not route data - .attr("foo", ...) works'); | ||
app.attr({ | ||
foo: false | ||
}); | ||
equal(app.attr('foo'), false, 'not route data - .attr({"foo": ...}) works'); | ||
iCanRoute.data = app; | ||
app.attr('foo', true); | ||
equal(app.attr('foo'), true, 'route data - .attr("foo", ...) works'); | ||
app.attr({ | ||
foo: false | ||
}); | ||
equal(app.attr('foo'), false, 'route data - .attr({"foo": ...}) works'); | ||
teardownRouteTest(); | ||
}); | ||
}); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107453
2411