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

Commit f389f86

Browse files
committed
fix($compile): use createMap() for $$observe listeners when initialized from attr interpolation
This reverts commit 8e28bb4.
1 parent 8e28bb4 commit f389f86

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

src/ng/compile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
23552355
compile: function() {
23562356
return {
23572357
pre: function attrInterpolatePreLinkFn(scope, element, attr) {
2358-
var $$observers = (attr.$$observers || (attr.$$observers = createMap()));
2358+
var $$observers = (attr.$$observers || (attr.$$observers = {}));
23592359

23602360
if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {
23612361
throw $compileMinErr('nodomevents',

test/ng/compileSpec.js

-17
Original file line numberDiff line numberDiff line change
@@ -3218,23 +3218,6 @@ describe('$compile', function() {
32183218
});
32193219
});
32203220

3221-
it('should be able to interpolate attribute names which are present in Object.prototype', function() {
3222-
var attrs;
3223-
module(function() {
3224-
directive('attrExposer', valueFn({
3225-
link: function($scope, $element, $attrs) {
3226-
attrs = $attrs;
3227-
}
3228-
}));
3229-
});
3230-
inject(function($compile, $rootScope) {
3231-
$compile('<div attr-exposer to-string="{{1 + 1}}" has-own-property="{{1 + 1}}">')($rootScope);
3232-
$rootScope.$apply();
3233-
expect(attrs.toString).toBe('2');
3234-
expect(attrs.hasOwnProperty).toBe('2');
3235-
});
3236-
});
3237-
32383221

32393222
describe('bind-once', function() {
32403223

0 commit comments

Comments
 (0)