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

Commit d5a94df

Browse files
committed
squash! wip
1 parent 064aec3 commit d5a94df

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

src/AngularPublic.js

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ function publishExternalAPI(angular) {
139139
'uppercase': uppercase,
140140
'callbacks': {counter: 0},
141141
'getTestability': getTestability,
142+
'$$interpolateMinErrors': $$interpolateMinErrors,
142143
'$$minErr': minErr,
143144
'$$csp': csp,
144145
'reloadWithDebugInfo': reloadWithDebugInfo

src/ng/interpolate.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
'use strict';
22

3-
var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');
4-
$interpolateMinErr.noconcat = function(text) {
5-
return $interpolateMinErr('noconcat',
6-
"Error while interpolating: {0}\nStrict Contextual Escaping disallows " +
7-
"interpolations that concatenate multiple expressions when a trusted value is " +
8-
"required. See http://docs.angularjs.org/api/ng.$sce", text);
9-
};
10-
11-
$interpolateMinErr.interr = function(text, err) {
12-
return $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, err.toString());
3+
var $interpolateMinErr = minErr('$interpolate');
4+
var $$interpolateMinErrors = {
5+
noconcat: function(text) {
6+
return $interpolateMinErr('noconcat',
7+
"Error while interpolating: {0}\nStrict Contextual Escaping disallows " +
8+
"interpolations that concatenate multiple expressions when a trusted value is " +
9+
"required. See http://docs.angularjs.org/api/ng.$sce", text);
10+
},
11+
interr: function(text, err) {
12+
return $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, err.toString());
13+
}
1314
};
1415

1516
/**

src/ngMessageFormat/messageFormatCommon.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// This file is compiled with Closure compiler's ADVANCED_OPTIMIZATIONS flag! Be wary of using
66
// constructs incompatible with that mode.
77

8-
var $interpolateMinErr = angular['$interpolateMinErr'];
8+
var $$interpolateMinErrors = angular['$$interpolateMinErrors'];
9+
var $interpolateMinErr = angular['$$minErr']('$interpolate');
910

1011
var noop = angular['noop'],
1112
isFunction = angular['isFunction'],

src/ngMessageFormat/messageFormatInterpolationParts.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// This file is compiled with Closure compiler's ADVANCED_OPTIMIZATIONS flag! Be wary of using
66
// constructs incompatible with that mode.
77

8-
/* global $interpolateMinErr: false */
8+
/* global $$interpolateMinErrors: false */
99
/* global isFunction: false */
1010
/* global parseTextLiteral: false */
1111

@@ -82,7 +82,7 @@ InterpolationParts.prototype.toParsedFn = function toParsedFn(mustHaveExpression
8282
return parseTextLiteral('');
8383
}
8484
if (this.trustedContext && this.textParts.length > 1) {
85-
throw $interpolateMinErr['noconcat'](originalText);
85+
throw $$interpolateMinErrors['noconcat'](originalText);
8686
}
8787
if (this.expressionFns.length === 0) {
8888
if (this.textParts.length != 1) { this.errorInParseLogic(); }

src/ngMessageFormat/messageFormatService.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// This file is compiled with Closure compiler's ADVANCED_OPTIMIZATIONS flag! Be wary of using
66
// constructs incompatible with that mode.
77

8+
/* global $$interpolateMinErrors: false */
89
/* global $interpolateMinErr: false */
910
/* global MessageFormatParser: false */
1011
/* global stringify: false */
@@ -28,7 +29,7 @@ function $$MessageFormatProvider() {
2829
value = trustedContext ? $sce['getTrusted'](trustedContext, value) : $sce['valueOf'](value);
2930
return allOrNothing && (value === void 0) ? value : stringify(value);
3031
} catch (err) {
31-
$exceptionHandler($interpolateMinErr['interr'](text, err));
32+
$exceptionHandler($$interpolateMinErrors['interr'](text, err));
3233
}
3334
};
3435
}

0 commit comments

Comments
 (0)