From 3b4965279c4f7a876317b5b71cd95ce30afc47a0 Mon Sep 17 00:00:00 2001 From: Marc Laval Date: Sun, 16 Aug 2015 01:30:18 +0200 Subject: [PATCH] feat(browser): support Edge Closes #3667 --- modules/angular2/src/facade/collection.ts | 2 +- modules/angular2/test/core/zone/ng_zone_spec.ts | 11 ++++++----- .../test/render/dom/compiler/shadow_css_spec.ts | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/angular2/src/facade/collection.ts b/modules/angular2/src/facade/collection.ts index cb3ba1cac9..97b6d8ef9f 100644 --- a/modules/angular2/src/facade/collection.ts +++ b/modules/angular2/src/facade/collection.ts @@ -242,7 +242,7 @@ export class ListWrapper { static join(list: List, s: string): string { return list.join(s); } static isEmpty(list: List): boolean { return list.length == 0; } static fill(list: List, value: any, start: number = 0, end: number = null) { - list.fill(value, start, end === null ? undefined : end); + list.fill(value, start, end === null ? list.length : end); } static equals(a: List, b: List): boolean { if (a.length != b.length) return false; diff --git a/modules/angular2/test/core/zone/ng_zone_spec.ts b/modules/angular2/test/core/zone/ng_zone_spec.ts index 2d3a7cfd8d..39b2044173 100644 --- a/modules/angular2/test/core/zone/ng_zone_spec.ts +++ b/modules/angular2/test/core/zone/ng_zone_spec.ts @@ -19,11 +19,12 @@ import {DOM} from 'angular2/src/dom/dom_adapter'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; -var isIE = DOM.getUserAgent().indexOf("Trident") > -1; +var isIEorEdge = + DOM.getUserAgent().indexOf("Trident") > -1 || DOM.getUserAgent().indexOf("Edge") > -1; // Schedules a macrotask (using a timer) function macroTask(fn: Function, timer = 1): void { - // adds longer timers for passing tests in IE - _zone.runOutsideAngular(() => TimerWrapper.setTimeout(fn, isIE ? timer : 1)); + // adds longer timers for passing tests in IE and Edge + _zone.runOutsideAngular(() => TimerWrapper.setTimeout(fn, isIEorEdge ? timer : 1)); } // Schedules a microtasks (using a resolved promise .then()) @@ -511,7 +512,7 @@ function commonTests() { macroTask(() => { _zone.run(() => { completerA.resolve(null); }); }, 20); - macroTask(() => { _zone.run(() => { completerB.resolve(null); }); }, 40); + macroTask(() => { _zone.run(() => { completerB.resolve(null); }); }, 60); macroTask(() => { expect(_log.result()) @@ -523,7 +524,7 @@ function commonTests() { // Third VM turn 'onTurnStart; b then; onTurnDone'); async.done(); - }, 80); + }, 90); })); it('should call onTurnStart and onTurnDone before and after (respectively) all turns in a chain', diff --git a/modules/angular2/test/render/dom/compiler/shadow_css_spec.ts b/modules/angular2/test/render/dom/compiler/shadow_css_spec.ts index e64b2cd0e5..66dd775558 100644 --- a/modules/angular2/test/render/dom/compiler/shadow_css_spec.ts +++ b/modules/angular2/test/render/dom/compiler/shadow_css_spec.ts @@ -66,7 +66,8 @@ export function main() { }); } - if (DOM.getUserAgent().indexOf('AppleWebKit') > -1) { + if (DOM.getUserAgent().indexOf('AppleWebKit') > -1 && + DOM.getUserAgent().indexOf('Edge') == -1) { it('should handle -webkit-keyframes rules', () => { var css = '@-webkit-keyframes foo {0% {-webkit-transform: translate(-50%) scaleX(0);}}'; var passRe =