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

Commit fe47ae7

Browse files
maleetzknalli
authored andcommitted
feat(*): support google closure compiler
Because of duplicate definitions of getTranslateNamespace in the same scope, google closure compiler returns the following error when minifying the angular-translate.js library with the SIMPLE compilation_level: - Duplicate let / const / class / function declaration in the same scope is not allowed. Change one of the getTranslateNamespace to be _getTranslateNamespace to avoid error.
1 parent f2de0d0 commit fe47ae7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/directive/translate-namespace.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function translateNamespaceDirective() {
6060
compile: function () {
6161
return {
6262
pre: function (scope, iElement, iAttrs) {
63-
scope.translateNamespace = getTranslateNamespace(scope);
63+
scope.translateNamespace = _getTranslateNamespace(scope);
6464

6565
if (scope.translateNamespace && iAttrs.translateNamespace.charAt(0) === '.') {
6666
scope.translateNamespace += iAttrs.translateNamespace;
@@ -79,13 +79,13 @@ function translateNamespaceDirective() {
7979
* @param scope
8080
* @returns {string}
8181
*/
82-
function getTranslateNamespace(scope) {
82+
function _getTranslateNamespace(scope) {
8383
'use strict';
8484
if (scope.translateNamespace) {
8585
return scope.translateNamespace;
8686
}
8787
if (scope.$parent) {
88-
return getTranslateNamespace(scope.$parent);
88+
return _getTranslateNamespace(scope.$parent);
8989
}
9090
}
9191

0 commit comments

Comments
 (0)