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