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

fix #536, add notification api patch #599

Merged
merged 1 commit into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
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
22 changes: 22 additions & 0 deletions lib/browser/webapis-notification.ts
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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