can-route
Advanced tools
Comparing version 5.0.0 to 5.0.1
// # can-route.js | ||
// Manage browser history and client state by synchronizing | ||
// Manage browser history and client state by synchronizing | ||
// the window.location.hash with an observable. | ||
@@ -29,3 +29,3 @@ | ||
// ## hashchangeObservable | ||
// `hashchangeObservable` is an instance of `Hashchange`, instances of | ||
// `hashchangeObservable` is an instance of `Hashchange`, instances of | ||
// `Hashchange` are two-way bound to `window.location.hash` once the | ||
@@ -350,2 +350,9 @@ // instances have a listener. | ||
set: function(data) { | ||
//!steal-remove-start | ||
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") { | ||
if (Object.keys(registerRoute.routes).length > 0) { | ||
devLog.warn("can-route: Setting can-route.data after calling can-route.register() may result in unexpected behavior. Set can-route.data before calling can-route.register()."); | ||
} | ||
} | ||
//!steal-remove-end | ||
if ( canReflect.isConstructorLike(data) ) { | ||
@@ -352,0 +359,0 @@ data = new data(); |
{ | ||
"name": "can-route", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Observable front-end application routing for CanJS.", | ||
@@ -73,3 +73,3 @@ "homepage": "https://canjs.com/doc/can-route.html", | ||
"steal-qunit": "^2.0.0", | ||
"steal-tools": "^1.1.2", | ||
"steal-tools": "^2.0.0", | ||
"test-saucelabs": "0.0.6", | ||
@@ -76,0 +76,0 @@ "testee": "^0.9.0" |
@@ -7,2 +7,4 @@ var canRoute = require("can-route"); | ||
var mockRoute = require("./mock-route-binding"); | ||
var RouteData = require("../src/routedata"); | ||
var testHelpers = require("can-test-helpers"); | ||
@@ -106,1 +108,10 @@ require("can-observation"); | ||
}); | ||
testHelpers.dev.devOnlyTest("should warn when .data is set after .register() is called", function (assert) { | ||
var teardown = testHelpers.dev.willWarn(/Set can-route.data before/); | ||
canRoute.register("{page}/{subpage}"); | ||
canRoute.data = new RouteData(); | ||
assert.equal(teardown(), 1); | ||
}); |
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
141399
3148
6