This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Syntax error in directive does not throw exception #15056
Milestone
Comments
This is not an Angular specific problem and also not a syntax error. When you do |
As @Narretz said, this is valid JS syntax and results into calling var obj = '...';
var propName = (function () {}).toString();
myModule.directive(obj[propName]); |
Ah, that makes sense. JavaScript has so many weird things that you can do. |
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Aug 28, 2016
Narretz
added a commit
that referenced
this issue
Aug 28, 2016
Narretz
added a commit
that referenced
this issue
Aug 30, 2016
petebacondarwin
pushed a commit
to petebacondarwin/angular.js
that referenced
this issue
Nov 21, 2016
petebacondarwin
pushed a commit
to petebacondarwin/angular.js
that referenced
this issue
Nov 21, 2016
petebacondarwin
pushed a commit
to petebacondarwin/angular.js
that referenced
this issue
Nov 21, 2016
petebacondarwin
pushed a commit
to petebacondarwin/angular.js
that referenced
this issue
Nov 21, 2016
petebacondarwin
pushed a commit
to petebacondarwin/angular.js
that referenced
this issue
Nov 21, 2016
petebacondarwin
pushed a commit
that referenced
this issue
Nov 23, 2016
petebacondarwin
pushed a commit
that referenced
this issue
Nov 24, 2016
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Do you want to request a feature or report a bug?
I am reporting a bug.
What is the current behavior?
If a directive is missing a comma in a particular position, no exception is thrown into the console and the directive does not work. Here is an example, where the missing comma is at the end of line 8 of the JavaScript section:
Working directive: https://jsfiddle.net/derfsubterfuge/y9xd3mdb/
Broken directive: https://jsfiddle.net/derfsubterfuge/2nfy6b4c/1/
The example is using Angular 1.5.8. I have attempted this on Fedora 24 for both Chrome 52.0.2743.116 (64-bit) and Firefox 48.0 (64-bit).
What is the expected behavior?
I would expect a syntax error to be thrown in the console and not swallowed.
The text was updated successfully, but these errors were encountered: