Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 83dfa97

Browse files
JiaLiPassionmhevery
authored andcommitted
fix: #536, add notification api patch (#599)
1 parent e3cd1f4 commit 83dfa97

File tree

6 files changed

+33
-4
lines changed

6 files changed

+33
-4
lines changed

Diff for: dist/webapis-media-query.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/webapis-notification.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: gulpfile.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ gulp.task('build/zone.min.js', ['compile-esm'], function(cb) {
8686
return generateScript('./lib/browser/rollup-main.ts', 'zone.min.js', true, cb);
8787
});
8888

89-
gulp.task('build/web-api.js', ['compile-esm'], function(cb) {
90-
return generateScript('./lib/browser/web-api.ts', 'web-api.js', true, cb);
89+
gulp.task('build/webapis-media-query.js', ['compile-esm'], function(cb) {
90+
return generateScript('./lib/browser/webapis-media-query.ts', 'webapis-media-query.js', true, cb);
91+
});
92+
93+
gulp.task('build/webapis-notification.js', ['compile-esm'], function(cb) {
94+
return generateScript('./lib/browser/webapis-notification.ts', 'webapis-notification.js', true, cb);
9195
});
9296

9397
gulp.task('build/jasmine-patch.js', ['compile-esm'], function(cb) {
@@ -155,7 +159,8 @@ gulp.task('build', [
155159
'build/zone.js.d.ts',
156160
'build/zone.min.js',
157161
'build/zone-node.js',
158-
'build/web-api.js',
162+
'build/webapis-media-query.js',
163+
'build/webapis-notification.js',
159164
'build/jasmine-patch.js',
160165
'build/jasmine-patch.min.js',
161166
'build/mocha-patch.js',
File renamed without changes.

Diff for: lib/browser/webapis-notification.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
import {patchOnProperties} from '../common/utils';
9+
10+
((_global: any) => {
11+
// patch Notification
12+
patchNotification(_global);
13+
14+
function patchNotification(_global: any) {
15+
const Notification = _global['Notification'];
16+
if (!Notification || !Notification.prototype) {
17+
return;
18+
}
19+
20+
patchOnProperties(Notification.prototype, null);
21+
}
22+
})(typeof window === 'object' && window || typeof self === 'object' && self || global);

Diff for: test/browser/MediaQuery.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import '../../lib/browser/web-api';
9+
import '../../lib/browser/webapis-media-query';
1010

1111
import {zoneSymbol} from '../../lib/common/utils';
1212
import {ifEnvSupports} from '../test-util';

0 commit comments

Comments
 (0)