diff --git a/packages/zone.js/lib/closure/zone_externs.js b/packages/zone.js/lib/closure/zone_externs.js index 10c8e621f32e6..46183b0e5f9b6 100644 --- a/packages/zone.js/lib/closure/zone_externs.js +++ b/packages/zone.js/lib/closure/zone_externs.js @@ -27,6 +27,10 @@ Zone.prototype.name; Zone.assertZonePatched = function() {}; +Zone.__symbol__ = function(name) {}; + +Zone.__load_patch = function(name, fn) {}; + /** * @type {!Zone} Returns the current [Zone]. Returns the current zone. The only way to change * the current zone is by invoking a run() method, which will update the current zone for the diff --git a/packages/zone.js/lib/zone.ts b/packages/zone.js/lib/zone.ts index c29962998004c..8898656c50e35 100644 --- a/packages/zone.js/lib/zone.ts +++ b/packages/zone.js/lib/zone.ts @@ -309,10 +309,15 @@ interface ZoneType { */ root: Zone; - /** @internal */ + /** + * load patch for specified native module, allow user to + * define their own patch, user can use this API after loading zone.js + */ __load_patch(name: string, fn: _PatchFn): void; - /** Was @ internal but this prevents compiling tests as separate unit */ + /** + * Zone symbol API to generate a string with __zone_symbol__ prefix + */ __symbol__(name: string): string; } diff --git a/packages/zone.js/test/closure/zone.closure.ts b/packages/zone.js/test/closure/zone.closure.ts index 00d0d4214385c..ebdcd7b927dff 100644 --- a/packages/zone.js/test/closure/zone.closure.ts +++ b/packages/zone.js/test/closure/zone.closure.ts @@ -52,6 +52,9 @@ const testClosureFunction = () => { } }; + Zone.__load_patch('test_closure_load_patch', function() {}); + Zone.__symbol__('test_symbol'); + const testZone: Zone = Zone.current.fork(testZoneSpec); testZone.runGuarded(() => { testZone.run(() => {