Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 7aada46

Browse files
committed
refactor($compile): remove unnecessary try/catch
1 parent 4883e95 commit 7aada46

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/ng/compile.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -2534,24 +2534,22 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
25342534
if (hasDirectives.hasOwnProperty(name)) {
25352535
for (var directive, directives = $injector.get(name + Suffix),
25362536
i = 0, ii = directives.length; i < ii; i++) {
2537-
try {
2538-
directive = directives[i];
2539-
if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
2540-
directive.restrict.indexOf(location) != -1) {
2541-
if (startAttrName) {
2542-
directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
2543-
}
2544-
if (!directive.$$bindings) {
2545-
var bindings = directive.$$bindings =
2546-
parseDirectiveBindings(directive, directive.name);
2547-
if (isObject(bindings.isolateScope)) {
2548-
directive.$$isolateBindings = bindings.isolateScope;
2549-
}
2537+
directive = directives[i];
2538+
if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
2539+
directive.restrict.indexOf(location) != -1) {
2540+
if (startAttrName) {
2541+
directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
2542+
}
2543+
if (!directive.$$bindings) {
2544+
var bindings = directive.$$bindings =
2545+
parseDirectiveBindings(directive, directive.name);
2546+
if (isObject(bindings.isolateScope)) {
2547+
directive.$$isolateBindings = bindings.isolateScope;
25502548
}
2551-
tDirectives.push(directive);
2552-
match = directive;
25532549
}
2554-
} catch (e) { $exceptionHandler(e); }
2550+
tDirectives.push(directive);
2551+
match = directive;
2552+
}
25552553
}
25562554
}
25572555
return match;

0 commit comments

Comments
 (0)