From d2825077b11e5f8ae41f924888bcb007846b343d Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Fri, 12 Aug 2016 14:15:37 -0700 Subject: [PATCH] fix(core): Removed depricated disposePlatform BREAKING CHANGE: previously deprecated disposePlatform was removed; see deprecation notice for migration instructions. --- modules/@angular/core/index.ts | 2 +- modules/@angular/core/src/application_ref.ts | 9 --------- .../platform-browser/test/browser/bootstrap_spec.ts | 6 +++--- .../@angular/platform-server/test/integration_spec.ts | 6 +++--- modules/@angular/upgrade/test/upgrade_spec.ts | 6 +++--- tools/public_api_guard/core/index.d.ts | 6 +++--- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/modules/@angular/core/index.ts b/modules/@angular/core/index.ts index cc1206dd63..406cf8476b 100644 --- a/modules/@angular/core/index.ts +++ b/modules/@angular/core/index.ts @@ -14,7 +14,7 @@ export * from './src/metadata'; export * from './src/util'; export * from './src/di'; -export {createPlatform, assertPlatform, disposePlatform, getPlatform, coreBootstrap, coreLoadAndBootstrap, PlatformRef, ApplicationRef, enableProdMode, isDevMode, createPlatformFactory} from './src/application_ref'; +export {createPlatform, assertPlatform, destroyPlatform, getPlatform, coreBootstrap, coreLoadAndBootstrap, PlatformRef, ApplicationRef, enableProdMode, isDevMode, createPlatformFactory} from './src/application_ref'; export {APP_ID, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER, APP_BOOTSTRAP_LISTENER} from './src/application_tokens'; export {APP_INITIALIZER, ApplicationInitStatus} from './src/application_init'; export * from './src/zone'; diff --git a/modules/@angular/core/src/application_ref.ts b/modules/@angular/core/src/application_ref.ts index 257f459912..ab8407c2dc 100644 --- a/modules/@angular/core/src/application_ref.ts +++ b/modules/@angular/core/src/application_ref.ts @@ -123,15 +123,6 @@ export function assertPlatform(requiredToken: any): PlatformRef { return platform; } -/** - * Dispose the existing platform. - * - * @deprecated Use `destroyPlatform` instead - */ -export function disposePlatform(): void { - destroyPlatform(); -} - /** * Destroy the existing platform. * diff --git a/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts b/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts index 4eba90a646..d062746f40 100644 --- a/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts +++ b/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts @@ -8,7 +8,7 @@ import {XHR} from '@angular/compiler'; import {APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, Component, Directive, ExceptionHandler, Inject, Input, NgModule, OnDestroy, PLATFORM_DIRECTIVES, PLATFORM_INITIALIZER, PLATFORM_PIPES, Pipe, ReflectiveInjector, createPlatform, createPlatformFactory, provide} from '@angular/core'; -import {ApplicationRef, disposePlatform} from '@angular/core/src/application_ref'; +import {ApplicationRef, destroyPlatform} from '@angular/core/src/application_ref'; import {Console} from '@angular/core/src/console'; import {ComponentRef} from '@angular/core/src/linker/component_factory'; import {Testability, TestabilityRegistry} from '@angular/core/src/testability/testability'; @@ -121,7 +121,7 @@ export function main() { beforeEachProviders(() => { return [Log]; }); beforeEach(() => { - disposePlatform(); + destroyPlatform(); fakeDoc = getDOM().createHtmlDocument(); el = getDOM().createElement('hello-app', fakeDoc); @@ -136,7 +136,7 @@ export function main() { [{provide: DOCUMENT, useValue: fakeDoc}, {provide: Console, useValue: compilerConsole}]; }); - afterEach(disposePlatform); + afterEach(destroyPlatform); it('should throw if bootstrapped Directive is not a Component', () => { expect(() => bootstrap(HelloRootDirectiveIsNotCmp)) diff --git a/modules/@angular/platform-server/test/integration_spec.ts b/modules/@angular/platform-server/test/integration_spec.ts index f8add7f216..cfd02ab82a 100644 --- a/modules/@angular/platform-server/test/integration_spec.ts +++ b/modules/@angular/platform-server/test/integration_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {Component, disposePlatform} from '@angular/core'; +import {Component, destroyPlatform} from '@angular/core'; import {async} from '@angular/core/testing'; import {BROWSER_APP_PROVIDERS} from '@angular/platform-browser'; import {BROWSER_APP_COMPILER_PROVIDERS} from '@angular/platform-browser-dynamic'; @@ -26,8 +26,8 @@ export function main() { describe('platform-server integration', () => { - beforeEach(() => disposePlatform()); - afterEach(() => disposePlatform()); + beforeEach(() => destroyPlatform()); + afterEach(() => destroyPlatform()); it('should bootstrap', async(() => { var body = writeBody(''); diff --git a/modules/@angular/upgrade/test/upgrade_spec.ts b/modules/@angular/upgrade/test/upgrade_spec.ts index d03f9a1714..537ee03c90 100644 --- a/modules/@angular/upgrade/test/upgrade_spec.ts +++ b/modules/@angular/upgrade/test/upgrade_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {Class, Component, EventEmitter, Inject, NgModule, OpaqueToken, Testability, disposePlatform} from '@angular/core'; +import {Class, Component, EventEmitter, Inject, NgModule, OpaqueToken, Testability, destroyPlatform} from '@angular/core'; import {async} from '@angular/core/testing'; import {AsyncTestCompleter, ddescribe, describe, expect, iit, inject, it} from '@angular/core/testing/testing_internal'; import {BrowserModule} from '@angular/platform-browser'; @@ -15,8 +15,8 @@ import * as angular from '@angular/upgrade/src/angular_js'; export function main() { describe('adapter: ng1 to ng2', () => { - beforeEach(() => disposePlatform()); - afterEach(() => disposePlatform()); + beforeEach(() => destroyPlatform()); + afterEach(() => destroyPlatform()); it('should have angular 1 loaded', () => expect(angular.version.major).toBe(1)); diff --git a/tools/public_api_guard/core/index.d.ts b/tools/public_api_guard/core/index.d.ts index 49cdda496d..79deeab892 100644 --- a/tools/public_api_guard/core/index.d.ts +++ b/tools/public_api_guard/core/index.d.ts @@ -488,6 +488,9 @@ export declare class DefaultIterableDiffer implements IterableDiffer { toString(): string; } +/** @experimental */ +export declare function destroyPlatform(): void; + /** @stable */ export declare var Directive: DirectiveMetadataFactory; @@ -532,9 +535,6 @@ export interface DirectiveMetadataType { selector?: string; } -/** @deprecated */ -export declare function disposePlatform(): void; - /** @stable */ export declare abstract class DoCheck { abstract ngDoCheck(): void;