mirror of https://github.com/huashengdun/webssh
Use private variable data instead of proto.data
parent
2adcf93362
commit
0f542ed24f
|
@ -6,12 +6,12 @@ var wssh = {};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
// For FormData without getter and setter
|
// For FormData without getter and setter
|
||||||
var proto = FormData.prototype;
|
var proto = FormData.prototype,
|
||||||
proto.data = {};
|
data = {};
|
||||||
|
|
||||||
if (!proto.get) {
|
if (!proto.get) {
|
||||||
proto.get = function (name) {
|
proto.get = function (name) {
|
||||||
if (!proto.data[name]) {
|
if (data[name] === undefined) {
|
||||||
var input = document.querySelector('input[name="' + name + '"]'),
|
var input = document.querySelector('input[name="' + name + '"]'),
|
||||||
value;
|
value;
|
||||||
if (input) {
|
if (input) {
|
||||||
|
@ -20,16 +20,16 @@ var wssh = {};
|
||||||
} else {
|
} else {
|
||||||
value = input.value;
|
value = input.value;
|
||||||
}
|
}
|
||||||
proto.data[name] = value;
|
data[name] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return proto.data[name];
|
return data[name];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!proto.set) {
|
if (!proto.set) {
|
||||||
proto.set = function (name, value) {
|
proto.set = function (name, value) {
|
||||||
proto.data[name] = value;
|
data[name] = value;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in New Issue