2015-01-04 19:40:09 +11:00

15 lines
286 B
JavaScript

function MyError(s) {
this.message = new String(s);
this.name = 'Error';
}
var object = {
method({message: [head, ...tail], name}) {
assert.equal('a', head);
assertArrayEquals(['b', 'c'], tail);
assert.equal('Error', name);
}
};
object.method(new MyError('abc'));