This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Bug: angular.equals not symmetric given objects with non-enumerable properties #14853
Closed
Description
POC:
let o = {}; Object.defineProperty(o, 'a', {value:1});
angular.equals(o , {}); // true
angular.equals({}, o); // true
angular.equals(o, {a: 1}); // false
angular.equals({a: 1}, o); // true
What the results of these should be are debatable but the last two should be at least symmetric. (Presumbly, both should return false
to retain transitivity.)
The use case of non-enumerable is I want to ignore certain deep/cyclical/non-important part of the tree from comparison when using Scope.$watch(..., ..., true)
.