aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Angular.js b/src/Angular.js
index aefe7ad5..22fb005e 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -215,7 +215,7 @@ function nextUid() {
/**
* Set or clear the hashkey for an object.
- * @param obj object
+ * @param obj object
* @param h the hashkey (!truthy to delete the hashkey)
*/
function setHashKey(obj, h) {
@@ -590,7 +590,10 @@ function isLeafNode (node) {
* @returns {*} The copy or updated `destination`, if `destination` was specified.
*/
function copy(source, destination){
- if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope");
+ if (isWindow(source) || isScope(source)) {
+ throw ngError(43, "Can't copy! Making copies of Window or Scope instances is not supported.");
+ }
+
if (!destination) {
destination = source;
if (source) {
@@ -603,7 +606,7 @@ function copy(source, destination){
}
}
} else {
- if (source === destination) throw Error("Can't copy equivalent objects or arrays");
+ if (source === destination) throw ngError(44, "Can't copy! Source and destination are identical.");
if (isArray(source)) {
destination.length = 0;
for ( var i = 0; i < source.length; i++) {
@@ -1055,7 +1058,7 @@ function bindJQuery() {
*/
function assertArg(arg, name, reason) {
if (!arg) {
- throw new Error("Argument '" + (name || '?') + "' is " + (reason || "required"));
+ throw ngError(45, "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
}
return arg;
}