Commit ba465421 authored by Tristan Cavelier's avatar Tristan Cavelier

ram.hasOwnProperty is not a function fix

parent d7c4e8ca
...@@ -64,6 +64,9 @@ ...@@ -64,6 +64,9 @@
], function (exports, jIO) { ], function (exports, jIO) {
"use strict"; "use strict";
var ram = {}, memorystorage, localstorage, hasOwnProperty =
Function.prototype.call.bind(Object.prototype.hasOwnProperty);
/** /**
* Checks if an object has no enumerable keys * Checks if an object has no enumerable keys
* *
...@@ -71,17 +74,16 @@ ...@@ -71,17 +74,16 @@
* @return {Boolean} true if empty, else false * @return {Boolean} true if empty, else false
*/ */
function objectIsEmpty(obj) { function objectIsEmpty(obj) {
/*jslint forin: true */
var k; var k;
for (k in obj) { for (k in obj) {
if (obj.hasOwnProperty(k)) { if (hasOwnProperty(obj, k)) {
return false; return false;
} }
} }
return true; return true;
} }
var ram = {}, memorystorage, localstorage;
/* /*
* Wrapper for the localStorage used to simplify instion of any kind of * Wrapper for the localStorage used to simplify instion of any kind of
* values * values
...@@ -414,11 +416,12 @@ ...@@ -414,11 +416,12 @@
"^" + jIO.Query.stringEscapeRegexpCharacters(this._localpath) + "^" + jIO.Query.stringEscapeRegexpCharacters(this._localpath) +
"/[^/]+$" "/[^/]+$"
); );
/*jslint forin: true */
if (options.query === undefined && options.sort_on === undefined && if (options.query === undefined && options.sort_on === undefined &&
options.select_list === undefined) { options.select_list === undefined) {
rows = []; rows = [];
for (i in this._database) { for (i in this._database) {
if (this._database.hasOwnProperty(i)) { if (hasOwnProperty(this._database, i)) {
// filter non-documents // filter non-documents
if (path_re.test(i)) { if (path_re.test(i)) {
row = { value: {} }; row = { value: {} };
...@@ -434,7 +437,7 @@ ...@@ -434,7 +437,7 @@
} else { } else {
// create jio query object from returned results // create jio query object from returned results
for (i in this._database) { for (i in this._database) {
if (this._database.hasOwnProperty(i)) { if (hasOwnProperty(this._database, i)) {
if (path_re.test(i)) { if (path_re.test(i)) {
document_list.push(this._storage.getItem(i)); document_list.push(this._storage.getItem(i));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment