diff --git a/frameworks/datastore/models/record.js b/frameworks/datastore/models/record.js index 0c06597ed4..63b37ec868 100644 --- a/frameworks/datastore/models/record.js +++ b/frameworks/datastore/models/record.js @@ -729,7 +729,7 @@ SC.Record = SC.Object.extend( @dependsOn status */ isError: function() { - return this.get('status') & SC.Record.ERROR; + return !!(this.get('status') & SC.Record.ERROR); }.property('status').cacheable(), /** diff --git a/frameworks/datastore/system/record_array.js b/frameworks/datastore/system/record_array.js index 88e5975eeb..82f26fe7ba 100644 --- a/frameworks/datastore/system/record_array.js +++ b/frameworks/datastore/system/record_array.js @@ -635,7 +635,7 @@ SC.RecordArray = SC.Object.extend(SC.Enumerable, SC.Array, @type Boolean */ isError: function() { - return this.get('status') & SC.Record.ERROR; + return !!(this.get('status') & SC.Record.ERROR); }.property('status').cacheable(), /** diff --git a/frameworks/datastore/tests/models/record/error_methods.js b/frameworks/datastore/tests/models/record/error_methods.js index a4aaecca90..5230c88545 100644 --- a/frameworks/datastore/tests/models/record/error_methods.js +++ b/frameworks/datastore/tests/models/record/error_methods.js @@ -45,8 +45,8 @@ test("Verify error methods behave correctly", function() { store.dataSourceDidError(storeKey, SC.Record.GENERIC_ERROR); SC.RunLoop.end(); - ok(thing1.get('isError'), "isError on thing1 should be YES"); - ok(!thing2.get('isError'), "isError on thing2 should be NO"); + ok((thing1.get('isError') === YES), "isError on thing1 should be YES"); + ok((thing2.get('isError') === NO), "isError on thing2 should be NO"); equals(thing1.get('errorObject'), SC.Record.GENERIC_ERROR, "get('errorObject') on thing1 should return the correct error object"); diff --git a/frameworks/datastore/tests/system/record_array/error_methods.js b/frameworks/datastore/tests/system/record_array/error_methods.js index b39ff94fa6..1adc6a6a8f 100644 --- a/frameworks/datastore/tests/system/record_array/error_methods.js +++ b/frameworks/datastore/tests/system/record_array/error_methods.js @@ -43,7 +43,7 @@ test("Verify error methods behave correctly", function() { store.dataSourceDidErrorQuery(q, SC.Record.GENERIC_ERROR); SC.RunLoop.end(); - ok(things.get('isError'), "isError on things array should be YES"); + ok((things.get('isError') === YES), "isError on things array should be YES"); equals(things.get('errorObject'), SC.Record.GENERIC_ERROR, "get('errorObject') on things array should return the correct error object");