Skip to content

Commit b062236

Browse files
committed
Avoid recursion when FQ is accessing jQuery.data
1 parent 687b108 commit b062236

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

chrome/resources/jquery2-patch.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
var originalRemoveData = $.originalRemoveDataReplacedByFireQuery = $.removeData;
4444

4545
var wrap2 = function(originalImp) {
46-
return function(elem) {
46+
return function(elem, name, value, forceInternals) {
4747
// snapshot previous state, apply original implementation, snapshot new state
4848
//var oldValues = $.extend(true, {}, originalData.apply(this, [elem])); // need to do a deep copy of the whole structure
4949
var res = originalImp.apply(this, arguments);
@@ -54,6 +54,14 @@
5454
oldValues: oldValues,
5555
newValues: newValues
5656
};*/
57+
58+
// Avoid recursion when FireQuery itself is accessing jQuery.data
59+
// xxxHonza: FireQuery needs a way how to access the original
60+
// $.originalDataReplacedByFireQuery() method FIXME
61+
if (forceInternals) {
62+
return res;
63+
}
64+
5765
// send event
5866
// xxxHonza: the event is sent twice from some reason (removeData is called automatically?).
5967
if (elem instanceof HTMLElement) {

0 commit comments

Comments
 (0)