[Pkg-javascript-commits] [dojo] 12/88: Fix bug collecting <script>'s that appear after normal child nodes. Issue was with unwinding the stack (ie, moving from a child to the parent). Fixes #15871 on 1.8/ branch !strict.

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.8.5
in repository dojo.

commit 3a7a1dda1c48592c51b36ec9a1665d98b26af5c8
Author: Bill Keese <bill at dojotoolkit.org>
Date:   Wed Aug 22 23:43:18 2012 +0000

    Fix bug collecting <script>'s that appear after normal child nodes.   Issue was with unwinding the stack (ie, moving from a child to the parent).   Fixes #15871 on 1.8/ branch !strict.
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.8/dojo@29527 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 parser.js                |  2 +-
 tests/parser/parser.html | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/parser.js b/parser.js
index 45d6eba..3494c39 100644
--- a/parser.js
+++ b/parser.js
@@ -545,9 +545,9 @@ define(
 						break;
 					}
 					node = parent.node.nextSibling;
-					scripts = parent.scripts;
 					scriptsOnly = false;
 					parent = parent.parent;
+					scripts = parent.scripts;
 					continue;
 				}
 
diff --git a/tests/parser/parser.html b/tests/parser/parser.html
index a14ad93..dea98d0 100644
--- a/tests/parser/parser.html
+++ b/tests/parser/parser.html
@@ -452,6 +452,14 @@
 						doh.t(objOnWatch.boolProp1, "ensure on executed in scope");
 					},
 
+					function testOn2(){
+						// testing script-type dojo/on, when script comes after another element
+						parser.parse("on");
+						doh.t("on_form" in window, "widget created");
+						on_form.emit("click");
+						doh.t(on_form.clicked, "on callback fired");
+					},
+
 					function testAspect(){
 						// testing script-type dojo/aspect
 						doh.t(typeof objAspect == "object");
@@ -919,6 +927,16 @@
 			</div>
 		</div> <!-- end of <div id=main> -->
 
+		<!-- more dojo/on tests -->
+		<div id="on">
+			<form action="/SomeUrl" data-dojo-type="tests.parser.StatefulClass" data-dojo-id="on_form">
+				<input data-dojo-type="tests.parser.InputClass" name="ACheckBox" />
+				<script type="dojo/on" data-dojo-event="click">
+					this.clicked = true;
+				</script>
+			</form>
+		</div>
+
 		<!-- section for testing parse on a subnode -->
 		<div>
 			<div data-dojo-type="tests.parser.Class1" jsId="obj2" id="toParse">

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list