I retrieved the rows from the WebSQL database and the returned rows look read-only.
db.readTransaction(
function(t1) {
t1.executeSql(
"SELECT * FROM Foo WHERE id = ?",
[1],
function(t2, resultSet){
var foo = resultSet.rows.item(0);
console.log("before: " + foo.col1);
foo.col1 = "new value";
console.log("after: " + foo.col1);
console.log("sealed? " + Object.isSealed(foo));
console.log("frozen? " + Object.isFrozen(foo));
}
);
}
);
He prints:
before: old value
after: old value
sealed? false
frozen? false
I had to manually clone the string in order to be able to modify it.
How is this possible? How can I make an object unchanged without freezing or sealing? And where in the specification say it should be so?
UPDATE: This is ridiculous. This only happens in some tables. Still ignorant of it.
UPDATE 2: No, this happens in every table I read. Something seems to be related to Chrome (also happens in Opera, so this could be the behavior of a web kit).