Skip to content

Instantly share code, notes, and snippets.

@a-one-d-one
Created March 15, 2018 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-one-d-one/913f5830b5bbfb1c7b6abf37eed79100 to your computer and use it in GitHub Desktop.
Save a-one-d-one/913f5830b5bbfb1c7b6abf37eed79100 to your computer and use it in GitHub Desktop.
Lab4 DPS909
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Spares arrays are only equivalent if they have the same length.
includes: [compareArray.js]
---*/
var assert = require('assert');
// if (compareArray([,], [,]) !== true) {
// $ERROR('Sparse arrays of the same length are equivalent.');
// }
/**** ^^^ EDITED ****/
assert.notDeepStrictEqual([,], [,], 'Sparse arrays of the same length are equivalent.');
// if (compareArray([,], [,,]) !== false) {
// $ERROR('Sparse arrays of differing lengths are not equivalent.');
// }
/**** ^^^ EDITED ****/
assert.deepStrictEqual([,], [,,], 'Sparse arrays of differing lengths are not equivalent.');
// if (compareArray([,,], [,]) !== false) {
// $ERROR('Sparse arrays of differing lengths are not equivalent.');
// }
/**** ^^^ EDITED ****/
assert.deepStrictEqual([,,], [,], 'Sparse arrays of differing lengths are not equivalent.');
// if (compareArray([,], []) !== false) {
// $ERROR('Sparse arrays are not equivalent to empty arrays.');
// }
/**** ^^^ EDITED ****/
assert.deepStrictEqual([,], [], 'Sparse arrays are not equivalent to empty arrays.');
// if (compareArray([], [,]) !== false) {
// $ERROR('Sparse arrays are not equivalent to empty arrays.');
// }
/**** ^^^ EDITED ****/
assert.deepStrictEqual([], [,], 'Sparse arrays are not equivalent to empty arrays.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment