diff options
author | James Shaw <jshaw@netsurf-browser.org> | 2007-10-05 22:07:38 +0000 |
---|---|---|
committer | James Shaw <jshaw@netsurf-browser.org> | 2007-10-05 22:07:38 +0000 |
commit | e41d0a993986cf63ea3b3129effd62d2afade6b1 (patch) | |
tree | 41bbb1f38ee2a7453aff3b55b7b09ff9cf383a74 /docs | |
parent | 95d2828dd29d700a6288dac7393e413647a6eeb4 (diff) | |
download | libdom-e41d0a993986cf63ea3b3129effd62d2afade6b1.tar.gz libdom-e41d0a993986cf63ea3b3129effd62d2afade6b1.tar.bz2 |
Add notes about casting/temp variables for asserts, control structures, attribute gets/sets and method calls
svn path=/trunk/dom/; revision=3624
Diffstat (limited to 'docs')
-rw-r--r-- | docs/TestSuite | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/docs/TestSuite b/docs/TestSuite index 1e43f18..789134a 100644 --- a/docs/TestSuite +++ b/docs/TestSuite @@ -259,8 +259,10 @@ DOMErrorMonitor UserDataMonitor UserDataNotification +LSInputStream DOM Level 3 Core only + Attr CDATASection CharacterData @@ -278,4 +280,74 @@ NodeList Notation ProcessingInstruction Text - DOM types
\ No newline at end of file + DOM types + +------------------------------------------------------------------------------- +WHAT ABOUT RETURN VALUES? +for method calls and attribute getters (&result) + +ASSERTIONS (other statements?) +[temp variables for assert params] +assertFoo(...) +for @expected, produce a var decl/ref +required-type is the type of @actual + + +CONDITIONS IN CONTROL STRUCTURES +[temp variables for condition params] +if (<condition>) +for every condition clause that requires it (e.g. <equals>), produce a var decl/ref +required-type is the type of @actual + e.g. + <var name="myVar" type="DOMString"/> + <equals actual="myVar" expected=""beans""/> + required-type is DOMString + +METHOD CALL +[temp variables for method params] +[temp variable to hold method result] +getElementsByTagName(doc, param_a, param_b, param_c, &result) +[assign temp variable to real result var] + +produce var decl/ref for each param: a, b, c +required-type is the method param's type in the domspec + + +ATTRIBUTE SET +[temp variables for setting attribute] +setFoo(node, param) + +required-type is the attribute's type in the domspec + + +ATTRIBUTE GET +[temp variable to hold getter result] +getFoo(node, &result) +[assign temp variable to real result var] + +call produce-var-reference in getFoo() call to generate &result +call produce-var-assignment after getFoo() to convert the temp result into the desired result + + +PSEUDO TEMPLATES +template name="produce-var-declaration" +param name="var-or-literal" +param name="required-type" +if (needs temp variable) + declare and assign new temporary variable $var_x$ +/if + +template name="produce-var-reference" +choose + when (needs temp variable) + print temporary variable $var_x$ using generate-id() + when (needs cast) + call-template name="cast" + otherwise + $var-or-literal +/choose + +template name="produce-var-assignment" +if (needs temp variable) + $var-or-literal = conversion_function($var_x$); +/if
\ No newline at end of file |