Skip to content

Instantly share code, notes, and snippets.

/**
Finds all storeKeys in this store
and returns an array.
@returns {Array} set of storeKeys
*/
storeKeys: function() {
ret = [];
if(!this.statuses) return;
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_6; de-de) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16
Hide passed testsCompleted 484 tests in 66935 msec. 1730 total assertions: 1651 passed 79 failed
Test Result
SC.compare() module: ordering should work - 93msec (26, 79, 0, 0)
v[0] (null) should be smaller than v[1] (boolean), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[2] (boolean), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[3] (number), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[4] (number), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[5] (string), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[6] (string), expected: -1 result: 0 FAILED
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Apple, Inc. and contributors.
// License: Licened under MIT license (see license.js)
// ==========================================================================
/*globals module ok equals same test MyApp */
// test parsing of query string
var v = [];
module("SC.compare()", {
ORDER_DEFINITION: [ SC.T_ERROR,
SC.T_UNDEFINED,
SC.T_NULL,
SC.T_BOOL,
SC.T_NUMBER,
SC.T_STRING,
SC.T_ARRAY,
SC.T_HASH,
SC.T_OBJECT,
SC.T_FUNCTION,
8 should equal itself, expected: 0 result: undefined FAILED
8 should be smaller than 9, expected: -1 result: undefined FAILED
9 should equal itself, expected: 0 result: undefined FAILED
10 should equal itself, expected: 0 result: undefined FAILED
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Apple, Inc. and contributors.
// License: Licened under MIT license (see license.js)
// ==========================================================================
/*globals module ok equals same test MyApp */
// test parsing of query string
var v = [], q, c;
module("SC.Query ordering", {
compareObjects: function (v1, v2) {
var orderDefinition = [SC.T_ERROR, SC.T_UNDEFINED, SC.T_NULL, SC.T_BOOL, SC.T_NUMBER, SC.T_STRING, SC.T_ARRAY, SC.T_HASH, SC.T_OBJECT, SC.T_FUNCTION, SC.T_CLASS];
var type1 = SC.typeOf(v1);
var type2 = SC.typeOf(v2);
if (orderDefinition.indexOf(type1) < orderDefinition.indexOf(type2)) return -1;
if (orderDefinition.indexOf(type1) > orderDefinition.indexOf(type2)) return 1;
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Apple, Inc. and contributors.
// License: Licened under MIT license (see license.js)
// ==========================================================================
/*globals module ok equals same test MyApp */
// test parsing of query string
var store, storeKey, rec1, rec2, rec3, rec4, rec5, MyApp, q;
module("SC.Query comparison/ordering of records", {
compareObjects: function (v1, v2) {
var orderDefinition = [SC.T_ERROR, SC.T_UNDEFINED, SC.T_NULL, SC.T_BOOL, SC.T_NUMBER, SC.T_STRING, SC.T_ARRAY, SC.T_HASH, SC.T_OBJECT, SC.T_FUNCTION, SC.T_CLASS];
//function getType (v) {
// var t = typeof v;
// if (t == 'object') {
// if (t == null) return 'null';
// if (t instanceof Array) return 'array';
// }
// this is a property of SC.Query:
compareObjects: function (v1, v2) {
var orderDefinition = ['null','boolean','number','string','array','object'];
getType = function (v) {
var t = typeof v;
if (t == 'object') {
if (t == null) return 'null';
if (t instanceof Array) return 'array';