From 6b79999adb6ec37476607f26b985501e8d33c6fc Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sun, 6 Mar 2011 10:37:20 -0500 Subject: [PATCH] IE6 Error.prototype.toString() !== Error.message --- test/test-class-extend.js | 2 +- test/test-class-name.js | 8 ++++---- test/test-interface-extend.js | 2 +- test/test-interface-name.js | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/test-class-extend.js b/test/test-class-extend.js index 6a78ac0..6def5f0 100644 --- a/test/test-class-extend.js +++ b/test/test-class-extend.js @@ -274,7 +274,7 @@ for ( var i = 0; i < class_count; i++ ) catch ( e ) { assert.notEqual( - e.toString().match( args.length + ' given' ), + e.message.match( args.length + ' given' ), null, "Class invocation should give argument count on error" ); diff --git a/test/test-class-name.js b/test/test-class-name.js index 19fa1b9..c5f00d7 100644 --- a/test/test-class-name.js +++ b/test/test-class-name.js @@ -66,7 +66,7 @@ var common = require( './common' ), catch ( e ) { assert.notEqual( - e.toString().match( name ), + e.message.match( name ), null, "Class definition argument count error string contains class name" ); @@ -96,7 +96,7 @@ var common = require( './common' ), } catch ( e ) { - var errstr = e.toString(); + var errstr = e.message; assert.notEqual( errstr.match( name ), @@ -256,7 +256,7 @@ var common = require( './common' ), catch ( e ) { assert.notEqual( - e.toString().match( name ), + e.message.match( name ), null, "Abstract class instantiation error should contain class name" ); @@ -276,7 +276,7 @@ var common = require( './common' ), catch ( e ) { assert.notEqual( - e.toString().match( '(anonymous)' ), + e.message.match( '(anonymous)' ), null, "Abstract class instantiation error should recognize that class " + "is anonymous if no name was given" diff --git a/test/test-interface-extend.js b/test/test-interface-extend.js index 2e542c7..f9197c5 100644 --- a/test/test-interface-extend.js +++ b/test/test-interface-extend.js @@ -192,7 +192,7 @@ for ( var i = 0; i < base_types.length; i++ ) catch ( e ) { assert.notEqual( - e.toString().match( args.length + ' given' ), + e.message.match( args.length + ' given' ), null, "Interface invocation should give argument count on error" ); diff --git a/test/test-interface-name.js b/test/test-interface-name.js index dad582c..f41f874 100644 --- a/test/test-interface-name.js +++ b/test/test-interface-name.js @@ -67,7 +67,7 @@ var common = require( './common' ), catch ( e ) { assert.notEqual( - e.toString().match( name ), + e.message.match( name ), null, "Interface definition argument count error string contains " + "interface name" @@ -98,7 +98,7 @@ var common = require( './common' ), } catch ( e ) { - var errstr = e.toString(); + var errstr = e.message; assert.notEqual( errstr.match( name ), @@ -210,7 +210,7 @@ var common = require( './common' ), { // ensure the error string contains the interface name assert.notEqual( - e.toString().match( name ), + e.message.match( name ), null, "Error contains interface name when available (" + i + ")" ); @@ -234,7 +234,7 @@ var common = require( './common' ), catch ( e ) { assert.notEqual( - e.toString().match( name ), + e.message.match( name ), null, "Interface name is included in instantiation error message" );