angular.js/test/service
Codier 29f9e2665d fix(scope): $watch (and angular.equals) should support NaN values
- since NaN !== NaN in javascript digest can get into an infinite loop
  when model value is set to NaN
- angular.equals(NaN, NaN) should return true since that's what we
  expect when comparing primitives or objects containing NaN values

Previously NaN because of its special === properties was used as the
initial value for watches, but that results in issues when NaN is used
as model value.

In order to allow for model to be anything incuding undefined and NaN we
need to mark the initial value differently in a way that would avoid
these issues, allow us to run digest without major perf penalties and
allow for clients to determine if the listener is being called because
the watcher is being initialized or because the model changed. This
implementation covers all of these scenarios.

BREAKING CHANGE: previously to detect if the listener was called because
the watcher was being initialized, it was suggested that clients check
if old value is NaN. With this change, the check should be if the newVal
equals the oldVal.

Closes #657
2011-11-21 15:43:12 -08:00
..
filter style(docs): make jslint happy - fix some warnings 2011-11-14 20:31:19 -08:00
browserSpecs.js chore(browser): rename Browser.js -> browser.js, BrowserSpec.js -> browserSpec.js 2011-11-18 12:05:55 -08:00
compilerSpec.js refactor(injector): switch to injector 2.0 introduce modules 2011-11-14 16:39:32 -08:00
cookiesSpec.js style(docs): make jslint happy - fix some warnings 2011-11-14 20:31:19 -08:00
cookieStoreSpec.js refactor(injector): turn scope into a service 2011-11-14 16:39:31 -08:00
deferSpec.js refactor(injector): switch to injector 2.0 introduce modules 2011-11-14 16:39:32 -08:00
documentSpec.js refactor(injector): turn scope into a service 2011-11-14 16:39:31 -08:00
exceptionHandlerSpec.js refactor(services): migrate angular.service -> module 2011-11-14 16:39:33 -08:00
formFactorySpec.js refactor(injector): turn scope into a service 2011-11-14 16:39:31 -08:00
localeSpec.js refactor(services): migrate angular.service -> module 2011-11-14 16:39:33 -08:00
locationSpec.js fix($location): links without path segment should not change the path 2011-11-14 20:31:17 -08:00
logSpec.js style(docs): make jslint happy - fix some warnings 2011-11-14 20:31:19 -08:00
parseSpec.js doc($filter): added $filter documentation 2011-11-14 20:31:16 -08:00
resourceSpec.js feat(strict mode): adding strict mode flag to all js files 2011-07-18 12:12:55 -07:00
routeParamsSpec.js refactor(injector): turn scope into a service 2011-11-14 16:39:31 -08:00
routeSpec.js refactor($service): removed almost all references to scope.$service 2011-11-14 16:39:33 -08:00
scopeSpec.js fix(scope): $watch (and angular.equals) should support NaN values 2011-11-21 15:43:12 -08:00
snifferSpec.js refactor(services): migrate angular.service -> module 2011-11-14 16:39:33 -08:00
windowSpec.js refactor(injector): turn scope into a service 2011-11-14 16:39:31 -08:00
xhr.bulkSpec.js refactor(injector): switch to injector 2.0 introduce modules 2011-11-14 16:39:32 -08:00
xhr.cacheSpec.js refactor(injector): switch to injector 2.0 introduce modules 2011-11-14 16:39:32 -08:00
xhr.errorSpec.js refactor(injector): switch to injector 2.0 introduce modules 2011-11-14 16:39:32 -08:00
xhrSpec.js refactor(injector): switch to injector 2.0 introduce modules 2011-11-14 16:39:32 -08:00