Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #551 from castaclip/master

corrected return values for SC.Record.isError() method
  • Loading branch information...
commit 5620c683cc1f9f8fca8db626df19e15b55b9bbd0 2 parents 39c62dd + 94e4ee5
@etgryphon etgryphon authored
View
2  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(),
/**
View
2  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(),
/**
View
4 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");
View
2  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");
Please sign in to comment.
Something went wrong with that request. Please try again.