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

Commit 94764ee

Browse files
committed
fix(minErr): remove references to internals APIs
So that we can use minErr with angular-loader, before full angular is loaded. This also fixes replacing the version during the build.
1 parent 04492ef commit 94764ee

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/grunt/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ module.exports = {
168168
var mapFile = minFile + '.map';
169169
var mapFileName = mapFile.match(/[^\/]+$/)[0];
170170
var errorFileName = file.replace(/\.js$/, '-errors.json');
171-
var versionNumber = this.getVersion().number;
171+
var versionNumber = this.getVersion().full;
172172
shell.exec(
173173
'java ' +
174174
this.java32flags() + ' ' +

src/minErr.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ function minErr(module) {
3535
template = arguments[1],
3636
templateArgs = arguments,
3737
stringify = function (obj) {
38-
if (isFunction(obj)) {
38+
if (typeof obj === 'function') {
3939
return obj.toString().replace(/ \{[\s\S]*$/, '');
40-
} else if (isUndefined(obj)) {
40+
} else if (typeof obj === 'undefined') {
4141
return 'undefined';
42-
} else if (!isString(obj)) {
42+
} else if (typeof obj !== 'string') {
4343
return JSON.stringify(obj);
4444
}
4545
return obj;
@@ -51,19 +51,19 @@ function minErr(module) {
5151

5252
if (index + 2 < templateArgs.length) {
5353
arg = templateArgs[index + 2];
54-
if (isFunction(arg)) {
54+
if (typeof arg === 'function') {
5555
return arg.toString().replace(/ ?\{[\s\S]*$/, '');
56-
} else if (isUndefined(arg)) {
56+
} else if (typeof arg === 'undefined') {
5757
return 'undefined';
58-
} else if (!isString(arg)) {
58+
} else if (typeof arg !== 'string') {
5959
return toJson(arg);
6060
}
6161
return arg;
6262
}
6363
return match;
6464
});
6565

66-
message = message + '\nhttp://errors.angularjs.org/' + version.full + '/' +
66+
message = message + '\nhttp://errors.angularjs.org/"NG_VERSION_FULL"/' +
6767
(module ? module + '/' : '') + code;
6868
for (i = 2; i < arguments.length; i++) {
6969
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +

0 commit comments

Comments
 (0)