refactor(core): remove looseIdentical
in favor of built-in Object.is
(#37191)
Remove `looseIdentical` implementation and instead use the ES2015 `Object.is` in its place. They behave exactly the same way except for `+0`/`-0`. `looseIdentical(+0, -0)` => `true` `Object.is(+0, -0)` => `false` Other than the difference noted above, this is not be a breaking change because: 1. `looseIdentical` is a private API 2. ES2015 is listed as a mandatory polyfill in the [browser support guide](https://angular.io/guide/browser-support#mandatory-polyfills) 3. Also note that `Ivy` already uses `Object.is` in `bindingUpdated`. PR Close #37191
This commit is contained in:

committed by
Matias Niemelä

parent
3e68029522
commit
ba0faa2f77
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Directive, DoCheck, ElementRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges, ɵlooseIdentical as looseIdentical} from '@angular/core';
|
||||
import {Directive, DoCheck, ElementRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges} from '@angular/core';
|
||||
|
||||
import {IAttributes, IAugmentedJQuery, IDirective, IInjectorService, ILinkFn, IScope, ITranscludeFunction} from '../../src/common/src/angular1';
|
||||
import {$SCOPE} from '../../src/common/src/constants';
|
||||
@ -206,7 +206,7 @@ export class UpgradeComponent implements OnInit, OnChanges, DoCheck, OnDestroy {
|
||||
const newValue = this.bindingDestination[propName];
|
||||
const oldValue = twoWayBoundLastValues[idx];
|
||||
|
||||
if (!looseIdentical(newValue, oldValue)) {
|
||||
if (!Object.is(newValue, oldValue)) {
|
||||
const outputName = propertyToOutputMap[propName];
|
||||
const eventEmitter: EventEmitter<any> = (this as any)[outputName];
|
||||
|
||||
|
Reference in New Issue
Block a user