This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 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) {
853853 if ( msie <= 11 ) {
854854 return false ;
855855 }
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/
858858 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 ) ) ;
860860 }
861861
862862 function invoke ( fn , self , locals , serviceName ) {
Original file line number Diff line number Diff line change @@ -302,6 +302,26 @@ describe('injector', function() {
302302 expect ( instance . aVal ( ) ) . toEqual ( 'a-value' ) ;
303303 } ) ;
304304
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+
305325 // Support: Chrome 50-51 only
306326 // TODO (gkalpak): Remove when Chrome v52 is relased.
307327 // it('should be able to invoke classes', function() {
You can’t perform that action at this time.
0 commit comments