aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/Angular.js b/src/Angular.js
index b7d77437..879efb35 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -3,16 +3,6 @@
////////////////////////////////////
/**
- * hasOwnProperty may be overwritten by a property of the same name, or entirely
- * absent from an object that does not inherit Object.prototype; this copy is
- * used instead
- */
-var hasOwnPropertyFn = Object.prototype.hasOwnProperty;
-var hasOwnPropertyLocal = function(obj, key) {
- return hasOwnPropertyFn.call(obj, key);
-};
-
-/**
* @ngdoc function
* @name angular.lowercase
* @function
@@ -691,6 +681,8 @@ function shallowCopy(src, dst) {
dst = dst || {};
for(var key in src) {
+ // shallowCopy is only ever called by $compile nodeLinkFn, which has control over src
+ // so we don't need to worry hasOwnProperty here
if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {
dst[key] = src[key];
}
@@ -1188,6 +1180,17 @@ function assertArgFn(arg, name, acceptArrayAnnotation) {
}
/**
+ * throw error if the name given is hasOwnProperty
+ * @param {String} name the name to test
+ * @param {String} context the context in which the name is used, such as module or directive
+ */
+function assertNotHasOwnProperty(name, context) {
+ if (name === 'hasOwnProperty') {
+ throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context);
+ }
+}
+
+/**
* Return the value accessible from the object by path. Any undefined traversals are ignored
* @param {Object} obj starting object
* @param {string} path path to traverse