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

Commit

Permalink
fix: #536, add notification api patch (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaLiPassion authored and mhevery committed Jan 17, 2017
1 parent e3cd1f4 commit 83dfa97
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions dist/webapis-media-query.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/webapis-notification.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions gulpfile.js
Expand Up @@ -86,8 +86,12 @@ gulp.task('build/zone.min.js', ['compile-esm'], function(cb) {
return generateScript('./lib/browser/rollup-main.ts', 'zone.min.js', true, cb);
});

gulp.task('build/web-api.js', ['compile-esm'], function(cb) {
return generateScript('./lib/browser/web-api.ts', 'web-api.js', true, cb);
gulp.task('build/webapis-media-query.js', ['compile-esm'], function(cb) {
return generateScript('./lib/browser/webapis-media-query.ts', 'webapis-media-query.js', true, cb);
});

gulp.task('build/webapis-notification.js', ['compile-esm'], function(cb) {
return generateScript('./lib/browser/webapis-notification.ts', 'webapis-notification.js', true, cb);
});

gulp.task('build/jasmine-patch.js', ['compile-esm'], function(cb) {
Expand Down Expand Up @@ -155,7 +159,8 @@ gulp.task('build', [
'build/zone.js.d.ts',
'build/zone.min.js',
'build/zone-node.js',
'build/web-api.js',
'build/webapis-media-query.js',
'build/webapis-notification.js',
'build/jasmine-patch.js',
'build/jasmine-patch.min.js',
'build/mocha-patch.js',
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions lib/browser/webapis-notification.ts
@@ -0,0 +1,22 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {patchOnProperties} from '../common/utils';

((_global: any) => {
// patch Notification
patchNotification(_global);

function patchNotification(_global: any) {
const Notification = _global['Notification'];
if (!Notification || !Notification.prototype) {
return;
}

patchOnProperties(Notification.prototype, null);
}
})(typeof window === 'object' && window || typeof self === 'object' && self || global);
2 changes: 1 addition & 1 deletion test/browser/MediaQuery.spec.ts
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

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

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

0 comments on commit 83dfa97

Please sign in to comment.