revert($compile): use createMap() for $$observe listeners when initialized from attr interpolation

This reverts commit 8e28bb4c2f.
This commit is contained in:
Lucas Galfaso
2014-12-14 13:22:56 +01:00
parent 8e28bb4c2f
commit 69f69db1e0
2 changed files with 1 additions and 18 deletions

View File

@@ -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',

View File

@@ -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('<div attr-exposer to-string="{{1 + 1}}" has-own-property="{{1 + 1}}">')($rootScope);
$rootScope.$apply();
expect(attrs.toString).toBe('2');
expect(attrs.hasOwnProperty).toBe('2');
});
});
describe('bind-once', function() {