W3C home > Mailing lists > Public > www-dom-ts@w3.org > September 2006

Re: DOM 3 LS testsuite bugs

From: Curt Arnold <carnold@houston.rr.com>
Date: Thu, 14 Sep 2006 00:18:42 -0500
Message-Id: <B093515E-2C23-4CBF-B54E-526F37B200E3@houston.rr.com>
Cc: www-dom-ts@w3c.org
To: Joao Eiras <joao.eiras@gmail.com>

Sorry, the previous response was incomplete.

On Sep 13, 2006, at 10:59 PM, Joao Eiras wrote:

> So far, to my knowledge, Opera is the only browser with LS support.
> So I tried the testsuite in Opera, and all I got was a bunch of  
> errors... so I though...
> Could those be Opera bugs?
> So I started to investigate, and found what tuned out to be a very  
> buggy testsuite, that doesn't work in any browser.
> the first problem is located in file
> http://www.w3.org/2004/04/ecmascript/level3/ls/ 
> DOMBuilderFilterTest0.html
> A testcase for the problem
> var foobar = 'hello';
> function test(){
>    assert(foobar == 'hello');
>    var foobar = 'world';
>    assert(foobar == 'world');
> }
> function assert(b){
>   if(!b){alert('assertion failed');throw "error";}
> }

I don't recognize the previous fragment in the test suite.  Where did  
you find that code.

> The problem is, the testsuite defines a global variable 'builder',  
> then accesses it inside the scope of a function, then afterwards it  
> declares a local variable with the same name. Probably they expect  
> for the 1st to refer to the global variable, and the second to the  
> local one...
> var builder = null;
> /* (...) */
> builder = createConfiguredBuilder();
> /* (...) */
> function DOMBuilderFilterTest0() {
>    var success;
>     //global variable referenced here, should yield an Object
>     if(checkInitialization(builder, "DOMBuilderFilterTest0") !=  
> null) return;
>     myfilter = new LSParserFilterN10027();
> /* (...) */
>     //local variable declared here - initial value is undefined
>     var builder;
> So please make sure to change the variable names.

This is a overlap between variables in the test and variable names in  
the framework (whose origin predates the writing of the LS test  
suite).  As far as I know, there should be ill effects from it since  
if a variable is introduced in the test, it would be defined in the  
scope of the test and all use within the test should be intended to  
use the function scope variable by that name and not the global  
scoped variable.  Does Opera produce a warning or otherwise complain  
about the local variable hiding the global scoped variable of the  
same name or is there another reason that you think this was a problem.

> Second problem,
> the function getResourceURI in the same file at line 174 is  
> undefined, doesn't exist, in any file or native UA implementation...
> Where does this come from ?

getResourceURI() is a method in the test framework to create a URI  
for the resource files loaded by the tests.  It is defined at line  
1191 in DOMTestSuite.js.

Been quite a while since I looked at this and I will not be able to  
investigate for several days due to other obligations.  It is  
possible that there are either problems in the test definitions (as  
written in XML), in the test transformations (that convert the XML to  
Javascript and Java) or in the supporting code which was not  
identified at the time this particular test suite was developed due  
to the lack of available implementations at the time.
Received on Thursday, 14 September 2006 05:18:50 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:07 UTC