From 69f69db1e0ebf0f1cb3a5dc369e6b3320a5b80c7 Mon Sep 17 00:00:00 2001 From: Lucas Galfaso Date: Sun, 14 Dec 2014 13:22:56 +0100 Subject: [PATCH] revert($compile): use createMap() for $$observe listeners when initialized from attr interpolation This reverts commit 8e28bb4c2f6d015dfe1cec7755f1ca9b0ecef1f8. --- src/ng/compile.js | 2 +- test/ng/compileSpec.js | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index dd0ac00b..387d6a40 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -2355,7 +2355,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { compile: function() { return { pre: function attrInterpolatePreLinkFn(scope, element, attr) { - var $$observers = (attr.$$observers || (attr.$$observers = createMap())); + var $$observers = (attr.$$observers || (attr.$$observers = {})); if (EVENT_HANDLER_ATTR_REGEXP.test(name)) { throw $compileMinErr('nodomevents', diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 909daaf6..1e4717ad 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -3218,23 +3218,6 @@ describe('$compile', function() { }); }); - it('should be able to interpolate attribute names which are present in Object.prototype', function() { - var attrs; - module(function() { - directive('attrExposer', valueFn({ - link: function($scope, $element, $attrs) { - attrs = $attrs; - } - })); - }); - inject(function($compile, $rootScope) { - $compile('
')($rootScope); - $rootScope.$apply(); - expect(attrs.toString).toBe('2'); - expect(attrs.hasOwnProperty).toBe('2'); - }); - }); - describe('bind-once', function() {