Commit ba465421 authored by Tristan Cavelier's avatar Tristan Cavelier

ram.hasOwnProperty is not a function fix

parent d7c4e8ca
......@@ -64,6 +64,9 @@
], function (exports, jIO) {
"use strict";
var ram = {}, memorystorage, localstorage, hasOwnProperty =
Function.prototype.call.bind(Object.prototype.hasOwnProperty);
/**
* Checks if an object has no enumerable keys
*
......@@ -71,17 +74,16 @@
* @return {Boolean} true if empty, else false
*/
function objectIsEmpty(obj) {
/*jslint forin: true */
var k;
for (k in obj) {
if (obj.hasOwnProperty(k)) {
if (hasOwnProperty(obj, k)) {
return false;
}
}
return true;
}
var ram = {}, memorystorage, localstorage;
/*
* Wrapper for the localStorage used to simplify instion of any kind of
* values
......@@ -414,11 +416,12 @@
"^" + jIO.Query.stringEscapeRegexpCharacters(this._localpath) +
"/[^/]+$"
);
/*jslint forin: true */
if (options.query === undefined && options.sort_on === undefined &&
options.select_list === undefined) {
rows = [];
for (i in this._database) {
if (this._database.hasOwnProperty(i)) {
if (hasOwnProperty(this._database, i)) {
// filter non-documents
if (path_re.test(i)) {
row = { value: {} };
......@@ -434,7 +437,7 @@
} else {
// create jio query object from returned results
for (i in this._database) {
if (this._database.hasOwnProperty(i)) {
if (hasOwnProperty(this._database, i)) {
if (path_re.test(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