Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

Commit

Permalink
fix(EventsHelper removeEvents): hasOwnProperty check to protect again…
Browse files Browse the repository at this point in the history
…t those that override Array.prototype issue #1652
  • Loading branch information
nmccready committed Dec 14, 2015
1 parent 1f8259d commit 4aa4994
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 31 deletions.
4 changes: 2 additions & 2 deletions dist/angular-google-maps-street-view.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! angular-google-maps 2.2.1 2015-12-10
/*! angular-google-maps 2.2.1 2015-12-14
* AngularJS directives for Google Maps
* git: https://github.com/angular-ui/angular-google-maps.git
*/
Expand Down Expand Up @@ -512,7 +512,7 @@ return UUID;
}
for (key in listeners) {
l = listeners[key];
if (l) {
if (l && listeners.hasOwnProperty(key)) {
google.maps.event.removeListener(l);
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-google-maps-street-view.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/angular-google-maps-street-view_dev_mapped.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-google-maps-street-view_dev_mapped.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/angular-google-maps-street-view_dev_mapped.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/angular-google-maps-street-view_dev_mapped.min.js.map

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions dist/angular-google-maps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! angular-google-maps 2.2.1 2015-12-10
/*! angular-google-maps 2.2.1 2015-12-14
* AngularJS directives for Google Maps
* git: https://github.com/angular-ui/angular-google-maps.git
*/
Expand Down Expand Up @@ -965,7 +965,7 @@ Nicholas McCready - https://twitter.com/nmccready
}
for (key in listeners) {
l = listeners[key];
if (l) {
if (l && listeners.hasOwnProperty(key)) {
google.maps.event.removeListener(l);
}
}
Expand Down Expand Up @@ -2500,10 +2500,7 @@ Nicholas McCready - https://twitter.com/nmccready
return;
}
value = mapArray.getAt(index);
if (!value) {
return;
}
if (!value.lng || !value.lat) {
if (!(value && value.lng && value.lat)) {
return;
}
geojsonArray[index][1] = value.lat();
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-google-maps.min.js

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions dist/angular-google-maps_dev_mapped.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! angular-google-maps 2.2.1 2015-12-10
/*! angular-google-maps 2.2.1 2015-12-14
* AngularJS directives for Google Maps
* git: https://github.com/angular-ui/angular-google-maps.git
*/
Expand Down Expand Up @@ -965,7 +965,7 @@ Nicholas McCready - https://twitter.com/nmccready
}
for (key in listeners) {
l = listeners[key];
if (l) {
if (l && listeners.hasOwnProperty(key)) {
google.maps.event.removeListener(l);
}
}
Expand Down Expand Up @@ -2500,10 +2500,7 @@ Nicholas McCready - https://twitter.com/nmccready
return;
}
value = mapArray.getAt(index);
if (!value) {
return;
}
if (!value.lng || !value.lat) {
if (!(value && value.lng && value.lat)) {
return;
}
geojsonArray[index][1] = value.lat();
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-google-maps_dev_mapped.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/angular-google-maps_dev_mapped.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/angular-google-maps_dev_mapped.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/coffee/directives/api/utils/events-helper.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ angular.module("uiGmapgoogle-maps.directives.api.utils")
removeEvents: (listeners) ->
return unless listeners
for key, l of listeners
google.maps.event.removeListener l if l
google.maps.event.removeListener(l) if l and listeners.hasOwnProperty(key)
return
]

0 comments on commit 4aa4994

Please sign in to comment.