From 5a11ac8ac683a2cc0ca70eb2075e196f965db1b4 Mon Sep 17 00:00:00 2001 From: Paul Spencer Date: Mon, 17 Dec 2007 16:44:00 +0000 Subject: [PATCH] patches Test.AnotherWay._constructor_name to return an appropriate value using 'typeof' instead of an empty string when the constructor of a value could not be correctly determined using the current logic. This fixes many of the tests in Safari 3 and does not appear to affect FF2 or IE6 since the current logic is working for them. git-svn-id: http://svn.openlayers.org/trunk/openlayers@5472 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/auto-tests.html | 14 ++++++++++++-- tests/run-tests.html | 13 ++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/tests/auto-tests.html b/tests/auto-tests.html index a02c0f2064..b73107e2fd 100644 --- a/tests/auto-tests.html +++ b/tests/auto-tests.html @@ -379,8 +379,18 @@ Test.AnotherWay._constructor_name=function( x ) }else if( s.match( /^\s*function\s+(\w+)\s*\(/ ) ) { return RegExp.$1; }else { - return ""; - } + var c = ''; + switch(typeof x) { + case 'string': + c = 'String'; + break; + case 'object': + c = 'Object'; + break; + default: + c = ''; + } + return c; } } Test.AnotherWay._is_array=function( x ) { diff --git a/tests/run-tests.html b/tests/run-tests.html index cabada0fec..ecc475c376 100644 --- a/tests/run-tests.html +++ b/tests/run-tests.html @@ -345,7 +345,18 @@ Test.AnotherWay._constructor_name=function( x ) }else if( s.match( /^\s*function\s+(\w+)\s*\(/ ) ) { return RegExp.$1; }else { - return ""; + var c = ''; + switch(typeof x) { + case 'string': + c = 'String'; + break; + case 'object': + c = 'Object'; + break; + default: + c = ''; + } + return c; } } Test.AnotherWay._is_array=function( x )