Skip to content

Instantly share code, notes, and snippets.

@pedrodelgallego
Created August 5, 2010 08:50
Show Gist options
  • Select an option

  • Save pedrodelgallego/509451 to your computer and use it in GitHub Desktop.

Select an option

Save pedrodelgallego/509451 to your computer and use it in GitHub Desktop.
//CHECK#1
try {
var x = [];
x.length = NaN;
$ERROR('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e));
}
}
//CHECK#4
try {
x = [];
x.length = undefined;
$ERROR('#4.1: x = []; x.length = undefined throw RangeError. Actual: x.length === ' + (x.length));
} catch(e) {
if ((e instanceof RangeError) !== true) {
$ERROR('#4.2: x = []; x.length = undefined throw RangeError. Actual: ' + (e));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment