This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +23
-3
lines changed
2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -853,10 +853,10 @@ function createInjector(modulesToLoad, strictDi) {
853
853
if ( msie <= 11 ) {
854
854
return false ;
855
855
}
856
- // Workaround for MS Edge.
857
- // Check https://connect .microsoft.com/IE/Feedback/Details/2211653
856
+ // Support: Edge 12-13 only
857
+ // See: https://developer .microsoft.com/en-us/microsoft-edge/platform/issues/6156135/
858
858
return typeof func === 'function'
859
- && / ^ (?: c l a s s \s | c o n s t r u c t o r \( ) / . test ( stringifyFn ( func ) ) ;
859
+ && / ^ (?: c l a s s \b | c o n s t r u c t o r \( ) / . test ( stringifyFn ( func ) ) ;
860
860
}
861
861
862
862
function invoke ( fn , self , locals , serviceName ) {
Original file line number Diff line number Diff line change @@ -302,6 +302,26 @@ describe('injector', function() {
302
302
expect ( instance . aVal ( ) ) . toEqual ( 'a-value' ) ;
303
303
} ) ;
304
304
305
+ if ( / c h r o m e / . test ( navigator . userAgent ) ) {
306
+ they ( 'should detect ES6 classes regardless of whitespace/comments ($prop)' , [
307
+ 'class Test {}' ,
308
+ 'class Test{}' ,
309
+ 'class //<--ES6 stuff\nTest {}' ,
310
+ 'class//<--ES6 stuff\nTest {}' ,
311
+ 'class {}' ,
312
+ 'class{}' ,
313
+ 'class //<--ES6 stuff\n {}' ,
314
+ 'class//<--ES6 stuff\n {}' ,
315
+ 'class/* Test */{}' ,
316
+ 'class /* Test */ {}'
317
+ ] , function ( classDefinition ) {
318
+ var Clazz = eval ( '(' + classDefinition + ')' ) ;
319
+ var instance = injector . invoke ( Clazz ) ;
320
+
321
+ expect ( instance ) . toEqual ( jasmine . any ( Clazz ) ) ;
322
+ } ) ;
323
+ }
324
+
305
325
// Support: Chrome 50-51 only
306
326
// TODO (gkalpak): Remove when Chrome v52 is relased.
307
327
// it('should be able to invoke classes', function() {
You can’t perform that action at this time.
0 commit comments