Commits

Stephen McKamey committed 0711059

standardizing on single-quotes for JS strings

Comments (0)

Files changed (13)

duel-js/src/main/javascript/bind.js

 	 * @constant
 	 * @type {string}
 	 */
-	var FOR = "$for";
+	var FOR = '$for';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var XOR = "$xor";
+	var XOR = '$xor';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var IF = "$if";
+	var IF = '$if';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var CALL = "$call";
+	var CALL = '$call';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var PART = "$part";
+	var PART = '$part';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var TEST = "test";
+	var TEST = 'test';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var EACH = "each";
+	var EACH = 'each';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var IN = "in";
+	var IN = 'in';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var VIEW = "view";
+	var VIEW = 'view';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var DATA = "data";
+	var DATA = 'data';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var INDEX = "index";
+	var INDEX = 'index';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var COUNT = "count";
+	var COUNT = 'count';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var KEY = "key";
+	var KEY = 'key';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var NAME = "name";
+	var NAME = 'name';
 
 	var bind;
 
 	function append(parent, child) {
 		switch (getType(child)) {
 			case ARY:
-				if (child[0] === "") {
+				if (child[0] === '') {
 					// child is documentFragment
 					// directly append children, skip fragment identifier
 					for (var i=1, length=child.length; i<length; i++) {
 				var last = parent.length-1;
 				if (last > 0 && getType(parent[last]) === VAL) {
 					// combine string literals
-					parent[last] = "" + parent[last] + child;
-				} else if (child !== "") {
+					parent[last] = '' + parent[last] + child;
+				} else if (child !== '') {
 					// convert primitive to string literal and append
-					parent.push("" + child);
+					parent.push('' + child);
 				}
 				break;
 	
 		}
 
 		// element array, make a doc frag
-		var result = [""];
+		var result = [''];
 
 		for (var i=hasAttr ? 2 : 1, length=node.length; i<length; i++) {
 			append(result, bind(node[i], data, index, count, key, parts));
 	 */
 	function loop(node, data, index, count, key, parts) {
 		var args = node[1] || {},
-			result = [""],
+			result = [''],
 			items, i, length;
 
 		if (args.hasOwnProperty(COUNT)) {
 	 */
 	function part(node, data, index, count, key, parts) {
 		var args = node[1] || {},
-			block = args[NAME] || "";
+			block = args[NAME] || '';
 
 		block = parts && parts.hasOwnProperty(block) ? parts[block] : node;
 
 				/**
 				 * @type {string}
 				 */
-				var tag = node[0] || "";
+				var tag = node[0] || '';
 				switch (tag) {
 					case FOR:
 						return loop(node, data, index, count, key, parts);

duel-js/src/main/javascript/dom.js

 	 * @constant
 	 * @type {string}
 	 */
-	var TODOM = "toDOM";
+	var TODOM = 'toDOM';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var RELOAD = "reload";
+	var RELOAD = 'reload';
 
 	/**
 	 * @private
 	 * @const
 	 * @type {string}
 	 */
-	var ATTR_EXTERN = "attr";
+	var ATTR_EXTERN = 'attr';
 
 	/**
 	 * @private
 	 * @const
 	 * @type {string}
 	 */
-	var REPLACE_EXTERN = "replace";
+	var REPLACE_EXTERN = 'replace';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var INIT = "$init";
+	var INIT = '$init';
 
 	/**
 	 * @private
 	 * @constant
 	 * @type {string}
 	 */
-	var LOAD = "$load";
+	var LOAD = '$load';
 
 	/**
 	 * Attribute name map
 	 * @type {Object.<string>}
 	 */
 	var ATTRMAP = {
-		"rowspan" : "rowSpan",
-		"colspan" : "colSpan",
-		"cellpadding" : "cellPadding",
-		"cellspacing" : "cellSpacing",
-		"tabindex" : "tabIndex",
-		"accesskey" : "accessKey",
-		"hidefocus" : "hideFocus",
-		"usemap" : "useMap",
-		"maxlength" : "maxLength",
-		"readonly" : "readOnly",
-		"contenteditable" : "contentEditable"
+		'rowspan' : 'rowSpan',
+		'colspan' : 'colSpan',
+		'cellpadding' : 'cellPadding',
+		'cellspacing' : 'cellSpacing',
+		'tabindex' : 'tabIndex',
+		'accesskey' : 'accessKey',
+		'hidefocus' : 'hideFocus',
+		'usemap' : 'useMap',
+		'maxlength' : 'maxLength',
+		'readonly' : 'readOnly',
+		'contenteditable' : 'contentEditable'
 		// can add more attributes here as needed
 	};
 
 	 * @type {Object.<string>}
 	 */
 	var ATTRDUP = {
-		"enctype" : "encoding",
-		"onscroll" : "DOMMouseScroll"
+		'enctype' : 'encoding',
+		'onscroll' : 'DOMMouseScroll'
 		// can add more attributes here as needed
 	};
 
 				return document.createDocumentFragment();
 			}
 
-			tag = "";
+			tag = '';
 
 		} else if (tag.charAt(0) === '!') {
-			return document.createComment(tag === "!" ? "" : tag.substr(1)+' ');
+			return document.createComment(tag === '!' ? '' : tag.substr(1)+' ');
 		}
 
-		if (tag.toLowerCase() === "style" && document.createStyleSheet) {
+		if (tag.toLowerCase() === 'style' && document.createStyleSheet) {
 			// IE requires this interface for styles
 			return document.createStyleSheet();
 		}
 	 */
 	function appendDOM(elem, child) {
 		if (child) {
-			var tag = (elem.tagName||"").toLowerCase();
+			var tag = (elem.tagName||'').toLowerCase();
 			if (elem.nodeType === 8) { // comment
 				if (child.nodeType === 3) { // text node
 					elem.nodeValue += child.nodeValue;
 				}
-			} else if (tag === "table" && elem.tBodies) {
+			} else if (tag === 'table' && elem.tBodies) {
 				if (!child.tagName) {
 					// must unwrap documentFragment for tables
 					if (child.nodeType === 11) {
 
 				// in IE must explicitly nest TRs in TBODY
 				var childTag = child.tagName.toLowerCase();// child tagName
-				if (childTag && childTag !== "tbody" && childTag !== "thead") {
+				if (childTag && childTag !== 'tbody' && childTag !== 'thead') {
 					// insert in last tbody
 					var tBody = elem.tBodies.length > 0 ? elem.tBodies[elem.tBodies.length-1] : null;
 					if (!tBody) {
-						tBody = createElement(childTag === "th" ? "thead" : "tbody");
+						tBody = createElement(childTag === 'th' ? 'thead' : 'tbody');
 						elem.appendChild(tBody);
 					}
 					tBody.appendChild(child);
 					elem.appendChild(child);
 				}
 
-			} else if (tag === "style" && document.createStyleSheet) {
+			} else if (tag === 'style' && document.createStyleSheet) {
 				// IE requires this interface for styles
 				elem.cssText = child;
 
 			} else if (elem.canHaveChildren !== false) {
 				elem.appendChild(child);
 
-			} else if (tag === "object" &&
-				child.tagName && child.tagName.toLowerCase() === "param") {
+			} else if (tag === 'object' &&
+				child.tagName && child.tagName.toLowerCase() === 'param') {
 					// IE-only path
 					try {
 						elem.appendChild(child);
 		else if (isString(handler)) {
 			// inline functions are DOM Level 0
 			/*jslint evil:true */
-			elem[name] = new Function("event", handler);
+			elem[name] = new Function('event', handler);
 			/*jslint evil:false */
 		}
 	}
 		if (attr.name && document.attachEvent && !elem.parentNode) {
 			try {
 				// IE fix for not being able to programatically change the name attribute
-				var alt = createElement("<"+elem.tagName+" name='"+attr.name+"'>");
+				var alt = createElement('<'+elem.tagName+' name="'+attr.name+'">');
 				// fix for Opera 8.5 and Netscape 7.1 creating malformed elements
 				if (elem.tagName === alt.tagName) {
 					elem = alt;
 
 				if (name) {
 					if (type === NUL) {
-						value = "";
+						value = '';
 						type = VAL;
 					}
 
 					name = ATTRMAP[name.toLowerCase()] || name;
-					if (name === "style") {
-						if (typeof elem.style.cssText !== "undefined") {
+					if (name === 'style') {
+						if (typeof elem.style.cssText !== 'undefined') {
 							elem.style.cssText = value;
 						} else {
 							elem.style = value;
 						}
 
-					} else if (name === "class") {
+					} else if (name === 'class') {
 						elem.className = value;
 
 					} else if (name.substr(0,2) === 'on') {
 	 */
 	function trimPattern(node, pattern) {
 		if (!!node && (node.nodeType === 3) && pattern.exec(node.nodeValue)) {
-			node.nodeValue = node.nodeValue.replace(pattern, "");
+			node.nodeValue = node.nodeValue.replace(pattern, '');
 		}
 	}
 
 	 * @return {Node}
 	 */
 	function toDOM(value) {
-		var wrapper = createElement("div");
-		wrapper.innerHTML = ""+value;
+		var wrapper = createElement('div');
+		wrapper.innerHTML = ''+value;
 	
 		// trim extraneous whitespace
 		trimWhitespace(wrapper);
 		}
 
 		// create a document fragment to hold elements
-		var frag = createElement("");
+		var frag = createElement('');
 		while (wrapper.firstChild) {
 			frag.appendChild(wrapper.firstChild);
 		}
 			if (!isFunction(method)) {
 				try {
 					/*jslint evil:true */
-					method = new Function(""+method);
+					method = new Function(''+method);
 					/*jslint evil:false */
 				} catch (ex2) {
 					// filter
 					var childTag = child[0];
 					child = patchDOM(createElement(childTag), child);
 
-					if (childTag === "html") {
+					if (childTag === 'html') {
 						// trim extraneous whitespace
 						trimWhitespace(child);
 
 					appendDOM(elem, child);
 					break;
 				case VAL:
-					if (child !== "") {
+					if (child !== '') {
 						// append child value as text
-						appendDOM(elem, document.createTextNode(""+child));
+						appendDOM(elem, document.createTextNode(''+child));
 					}
 					break;
 				case OBJ:
 			if (doc.createStyleSheet) {
 				// IE requires link repair
 				var head = newRoot.firstChild;
-				while (head && (head.tagName||"") !== "HEAD") {
+				while (head && (head.tagName||'') !== 'HEAD') {
 					head = head.nextSibling;
 				}
 
 				var link = head && head.firstChild;
 				while (link) {
-					if ((link.tagName||"") === "LINK") {
+					if ((link.tagName||'') === 'LINK') {
 						// this seems to repair the link
 						link.href = link.href;
 					}
 			}
 		} catch (ex) {
 			/*jslint evil:true*/
-			doc = doc.open("text/html");
+			doc = doc.open('text/html');
 			doc.write(this.toString());
 			doc.close();
 			/*jslint evil:false*/

duel-js/src/main/javascript/factory.js

 	 * @const
 	 * @type {string}
 	 */
-	var DUEL_EXTERN = "duel";
+	var DUEL_EXTERN = 'duel';
 
 	/**
 	 * @private
 	 * @const
 	 * @type {string}
 	 */
-	var RAW_EXTERN = "raw";
+	var RAW_EXTERN = 'raw';
 
 	/**
 	 * Renders an error as text
 	 * @return {string}
 	 */
 	function onError(ex) {
-		return "["+ex+"]";
+		return '['+ex+']';
 	}
 
 	/**
 	function factory(view) {
 		if (getType(view) !== ARY) {
 			// ensure is rooted element
-			view = ["", view];
+			view = ['', view];
 		}
 
 		/**

duel-js/src/main/javascript/intro.js

 var duel = (
 	/**
 	 * @param {Window} window Window reference
+	 * @param {Document} document Document reference
 	 */
-	function(window) {
+	function(window, document) {
 
-	"use strict";
+	'use strict';
 
-	/**
-	 * @type {Document} document Document reference
-	 */
-	var document = window.document;
-

duel-js/src/main/javascript/outro.js

 	return duel;
 
-})(window);
+})(window, document);

duel-js/src/main/javascript/render.js

 	 * @type {Object.<boolean>}
 	 */
 	var VOID_TAGS = {
-		"area" : true,
-		"base" : true,
-		"basefont" : true,
-		"br" : true,
-		"col" : true,
-		"frame" : true,
-		"hr" : true,
-		"img" : true,
-		"input" : true,
-		"isindex" : true,
-		"keygen" : true,
-		"link" : true,
-		"meta" : true,
-		"param" : true,
-		"source" : true,
-		"wbr" : true
+		'area' : true,
+		'base' : true,
+		'basefont' : true,
+		'br' : true,
+		'col' : true,
+		'frame' : true,
+		'hr' : true,
+		'img' : true,
+		'input' : true,
+		'isindex' : true,
+		'keygen' : true,
+		'link' : true,
+		'meta' : true,
+		'param' : true,
+		'source' : true,
+		'wbr' : true
 	};
 
 	/**
 	 * @const
 	 * @type {string}
 	 */
-	var WRITE_EXTERN = "write";
+	var WRITE_EXTERN = 'write';
 
 	/**
 	 * Encodes invalid literal characters in strings
 			function(ch) {
 				switch(ch) {
 					case '&':
-						return "&amp;";
+						return '&amp;';
 					case '<':
-						return "&lt;";
+						return '&lt;';
 					case '>':
-						return "&gt;";
+						return '&gt;';
 					default:
 						return ch;
 				}
 			function(ch) {
 				switch(ch) {
 					case '&':
-						return "&amp;";
+						return '&amp;';
 					case '<':
-						return "&lt;";
+						return '&lt;';
 					case '>':
-						return "&gt;";
+						return '&gt;';
 					case '"':
-						return "&quot;";
+						return '&quot;';
 					default:
 						return ch;
 				}
 	 */
 	function renderElem(buffer, node) {
 
-		var tag = node[0] || "",
+		var tag = node[0] || '',
 			length = node.length,
 			i = 1,
 			child,

duel-js/src/main/javascript/types.js

 	 * @constant
 	 * @type {string}
 	 */
-	var MSIE = "ScriptEngineMajorVersion";
+	var MSIE = 'ScriptEngineMajorVersion';
 
 	/**
 	 * Wraps a data value to maintain as raw markup in output
 	 */
 	function getType(val) {
 		switch (typeof val) {
-			case "object":
+			case 'object':
 				return !val ? NUL : (isArray(val) ? ARY : ((val instanceof Markup) ? RAW : ((val instanceof Date) ? VAL : OBJ)));
-			case "function":
+			case 'function':
 				return FUN;
-			case "undefined":
+			case 'undefined':
 				return NUL;
 			default:
 				return VAL;
 	 * @return {boolean}
 	 */
 	function isString(val) {
-		return (typeof val === "string");
+		return (typeof val === 'string');
 	}
 
 	/**
 	 * @return {boolean}
 	 */
 	function isFunction(val) {
-		return (typeof val === "function");
+		return (typeof val === 'function');
 	}
 
 	/**
 		 * @type {Array|string}
 		 * @private
 		 */
-		this.value = Buffer.FAST ? "" : [];
+		this.value = Buffer.FAST ? '' : [];
 	}
 
 	/**
 	 * @this {Buffer}
 	 */
 	Buffer.prototype.clear = function() {
-		this.value = Buffer.FAST ? "" : [];
+		this.value = Buffer.FAST ? '' : [];
 	};
 
 	/**
 		return Buffer.FAST ?
 			// Closure Compiler type cast
 			/** @type{string} */(this.value) :
-			this.value.join("");
+			this.value.join('');
 	};
 
 	function digits(n) {
 		var buffer, needsDelim;
 		switch (getType(val)) {
 			case VAL:
-				return ""+val;
+				return ''+val;
 			case NUL:
-				return "";
+				return '';
 			case ARY:
 				// flatten into simple list
 				buffer = new Buffer();
 				for (var i=0, length=val.length; i<length; i++) {
 					if (needsDelim) {
-						buffer.append(", ");
+						buffer.append(', ');
 					} else {
 						needsDelim = true;
 					}
 				for (var key in val) {
 					if (val.hasOwnProperty(key)) {
 						if (needsDelim) {
-							buffer.append(", ");
+							buffer.append(', ');
 						} else {
 							needsDelim = true;
 						}
 	function Result(view) {
 		if (!isArray(view)) {
 			// ensure is rooted element
-			view = ["", view];
+			view = ['', view];
 		}
 	
 		/**

duel-js/src/test/javascript/bindTests.js

 try{
 
-module("duel(data)");
+module('duel(data)');
 
-test("static view", function() {
+test('static view', function() {
 
 	var expected =
-		["div", { "class" : "list", "style" : "color:blue" },
-			["h2", "This is the title"],
-			["ul",
-				["li", { "class" : "item" },
-					["b", "Example"],
-					": ",
-					["i", "First!"]
+		['div', { 'class' : 'list', 'style' : 'color:blue' },
+			['h2', 'This is the title'],
+			['ul',
+				['li', { 'class' : 'item' },
+					['b', 'Example'],
+					': ',
+					['i', 'First!']
 				],
-				["li", { "class" : "item" },
-					["b", "Sample"],
-					": ",
-					["i", "Last!"]
+				['li', { 'class' : 'item' },
+					['b', 'Sample'],
+					': ',
+					['i', 'Last!']
 				]
 			]
 		];
 
 	var actual = duel(expected)().value;
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("simple expressions", function() {
+test('simple expressions', function() {
 
 	var data = {
-	        name: "Foo.js",
-	        url: "http://example.com/foo.js",
+	        name: 'Foo.js',
+	        url: 'http://example.com/foo.js',
 	        size: 5.87,
 	        datestamp: new Date(),
-	        details: "Lorem ipsum dolor sit amet"
+	        details: 'Lorem ipsum dolor sit amet'
 	    };
 
 	var view = duel(
-		["div", { "class" : "download" },
-			["h2",
-			 	"Filename: ",
+		['div', { 'class' : 'download' },
+			['h2',
+			 	'Filename: ',
 				function(data, index, count) { return data.name; }
 			],
-			["p",
-			 	"URL: ",
-			 	["a", { "href" : function(data, index, count) { return data.url; }, "target" : "_blank" },
+			['p',
+			 	'URL: ',
+			 	['a', { 'href' : function(data, index, count) { return data.url; }, 'target' : '_blank' },
 			 	 	function(data, index, count) { return data.url ;}
 			 	],
-			 	" (",
+			 	' (',
 			 	function(data, index, count) { return data.size ;},
-			 	"KB)"
+			 	'KB)'
 		 	],
-			["p",
-			 	"DateStamp: ",
+			['p',
+			 	'DateStamp: ',
 			 	function(data, index, count) { return data.datestamp; }
 			],
-			["p",
-			 	"Description: ",
+			['p',
+			 	'Description: ',
 			 	function(data, index, count) { return data.details; }
 			]
 		]);
 	var actual = view(data).value;
 
 	var expected = 
-		["div", { "class" : "download" },
-			["h2",
-			 	"Filename: Foo.js"
+		['div', { 'class' : 'download' },
+			['h2',
+			 	'Filename: Foo.js'
 			],
-			["p",
-			 	"URL: ",
-			 	["a", { "href" : "http://example.com/foo.js", "target" : "_blank" },
-			 		"http://example.com/foo.js"
+			['p',
+			 	'URL: ',
+			 	['a', { 'href' : 'http://example.com/foo.js', 'target' : '_blank' },
+			 		'http://example.com/foo.js'
 		 		],
-			 	" (5.87KB)"
+			 	' (5.87KB)'
 		 	],
-			["p",
-			 	"DateStamp: "+data.datestamp
+			['p',
+			 	'DateStamp: '+data.datestamp
 			],
-			["p",
-			 	"Description: Lorem ipsum dolor sit amet"
+			['p',
+			 	'Description: Lorem ipsum dolor sit amet'
 			]
 		];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("simple orphaned if/else", function() {
+test('simple orphaned if/else', function() {
 
 	var view = duel(
-		["",
-		 	["$if", { "test" : function(data, index, count) { return data.name === "Example"; } },
-		 	 	["p", "True: Example === ", function(data, index, count) { return data.name; } ]
+		['',
+		 	['$if', { 'test' : function(data, index, count) { return data.name === 'Example'; } },
+		 	 	['p', 'True: Example === ', function(data, index, count) { return data.name; } ]
 		 	],
-		 	["$if", { "test" : function(data, index, count) { return data.name !== "Example"; } },
-		 	 	["p", "False: Example !== ", function(data, index, count) { return data.name; } ]
+		 	['$if', { 'test' : function(data, index, count) { return data.name !== 'Example'; } },
+		 	 	['p', 'False: Example !== ', function(data, index, count) { return data.name; } ]
 		 	],
-		 	["$if",
-		 	 	["p", "Both: orphaned else always executes" ]
+		 	['$if',
+		 	 	['p', 'Both: orphaned else always executes' ]
 		 	]
 		]);
 
-	var data1 = { name: "Example" };
+	var data1 = { name: 'Example' };
 	var actual1 = view(data1).value;
 	var expected1 =
-		["",
-		 	["p", "True: Example === Example"],
-		 	["p", "Both: orphaned else always executes" ]
+		['',
+		 	['p', 'True: Example === Example'],
+		 	['p', 'Both: orphaned else always executes' ]
 		];
 
-	same(actual1, expected1, "Binding with simple if statements.");
+	same(actual1, expected1, 'Binding with simple if statements.');
 
-	var data2 = { name: "Sample" };
+	var data2 = { name: 'Sample' };
 	var actual2 = view(data2).value;
 	var expected2 =
-		["",
-		 	["p", "False: Example !== Sample"],
-		 	["p", "Both: orphaned else always executes" ]
+		['',
+		 	['p', 'False: Example !== Sample'],
+		 	['p', 'Both: orphaned else always executes' ]
 		];
 
-	same(actual2, expected2, "");
+	same(actual2, expected2, '');
 });
 
-test("XOR block", function() {
+test('XOR block', function() {
 
 	var view = duel(
-	 	["$xor",
-		 	["$if", { "test" : function(data, index, count) { return !data.children || !data.children.length; } },
-		 	 	["p", "Has no items."]
+	 	['$xor',
+		 	['$if', { 'test' : function(data, index, count) { return !data.children || !data.children.length; } },
+		 	 	['p', 'Has no items.']
 		 	],
-		 	["$if", { "test" : function(data, index, count) { return data.children && data.children.length === 1; } },
-		 	 	["p", "Has only one item."]
+		 	['$if', { 'test' : function(data, index, count) { return data.children && data.children.length === 1; } },
+		 	 	['p', 'Has only one item.']
 		 	],
-		 	["$if",
-		 	 	["p", "Has ", function(data, index, count) { return data.children.length; }, " items."]
+		 	['$if',
+		 	 	['p', 'Has ', function(data, index, count) { return data.children.length; }, ' items.']
 		 	]
 	 	]);
 
-	var data1 = { name: "Three", children: [0,2,4] };
+	var data1 = { name: 'Three', children: [0,2,4] };
 	var actual1 = view(data1).value;
-	var expected1 = ["p", "Has 3 items."];
+	var expected1 = ['p', 'Has 3 items.'];
 
-	same(actual1, expected1, "Binding with choose block.");
+	same(actual1, expected1, 'Binding with choose block.');
 
-	var data2 = { name: "One", children: [42] };
+	var data2 = { name: 'One', children: [42] };
 	var actual2 = view(data2).value;
-	var expected2 = ["p", "Has only one item."];
+	var expected2 = ['p', 'Has only one item.'];
 
-	same(actual2, expected2, "Binding with choose block.");
+	same(actual2, expected2, 'Binding with choose block.');
 
-	var data3 = { name: "Zero", children: [] };
+	var data3 = { name: 'Zero', children: [] };
 	var actual3 = view(data3).value;
-	var expected3 = ["p", "Has no items."];
+	var expected3 = ['p', 'Has no items.'];
 
-	same(actual3, expected3, "");
+	same(actual3, expected3, '');
 });
 
-test("for-each array", function() {
+test('for-each array', function() {
 
 	var data = {
-	        title: "This is the title",
+	        title: 'This is the title',
 	        items: [
-	            { name: "One" },
-	            { name: "Two" },
-	            { name: "Three" },
-	            { name: "Four" },
-	            { name: "Five" }
+	            { name: 'One' },
+	            { name: 'Two' },
+	            { name: 'Three' },
+	            { name: 'Four' },
+	            { name: 'Five' }
 	        ]
 	    };
 
 	var view = duel(
-		["div", { "class" : "list", "style" : "color:blue" },
-			["h2",
+		['div', { 'class' : 'list', 'style' : 'color:blue' },
+			['h2',
 			 	function(data, index, count) { return data.title; }
 			],
-			["ul",
-			 	["$for", { "each" : function(data, index, count) { return data.items; } },
-					["li", { "class" : "item" },
-						["b",
+			['ul',
+			 	['$for', { 'each' : function(data, index, count) { return data.items; } },
+					['li', { 'class' : 'item' },
+						['b',
 						 	function(data, index, count) { return data.name; }
 						],
-						": ",
-						["i",
+						': ',
+						['i',
 						 	function(data, index, count) { return index + 1; },
-							" of ",
+							' of ',
 							function(data, index, count) { return count; }
 						]
 					]
 	var actual = view(data).value;
 
 	var expected =
-		["div", { "class" : "list", "style" : "color:blue" },
-			["h2", "This is the title"],
-			["ul",
-				["li", { "class" : "item" },
-					["b", "One"],
-					": ",
-					["i", "1 of 5"]
+		['div', { 'class' : 'list', 'style' : 'color:blue' },
+			['h2', 'This is the title'],
+			['ul',
+				['li', { 'class' : 'item' },
+					['b', 'One'],
+					': ',
+					['i', '1 of 5']
 				],
-				["li", { "class" : "item" },
-					["b", "Two"],
-					": ",
-					["i", "2 of 5" ]
+				['li', { 'class' : 'item' },
+					['b', 'Two'],
+					': ',
+					['i', '2 of 5' ]
 				],
-				["li", { "class" : "item" },
-					["b", "Three"],
-					": ",
-					["i", "3 of 5"]
+				['li', { 'class' : 'item' },
+					['b', 'Three'],
+					': ',
+					['i', '3 of 5']
 				],
-				["li", { "class" : "item" },
-					["b", "Four"],
-					": ",
-					["i", "4 of 5"]
+				['li', { 'class' : 'item' },
+					['b', 'Four'],
+					': ',
+					['i', '4 of 5']
 				],
-				["li", { "class" : "item" },
-					["b", "Five"],
-					": ",
-					["i", "5 of 5"]
+				['li', { 'class' : 'item' },
+					['b', 'Five'],
+					': ',
+					['i', '5 of 5']
 				]
 			]
 		];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("for-each primitive", function() {
+test('for-each primitive', function() {
 
 	var data = {
-	        title: "This is the title",
-	        items: "One"
+	        title: 'This is the title',
+	        items: 'One'
 	    };
 
 	var view = duel(
-		["div", { "class" : "list", "style" : "color:blue" },
-			["h2",
+		['div', { 'class' : 'list', 'style' : 'color:blue' },
+			['h2',
 			 	function(data, index, count) { return data.title; }
 			],
-			["ul",
-			 	["$for", { "each" : function(data, index, count) { return data.items; } },
-					["li", { "class" : "item" },
-						["b",
+			['ul',
+			 	['$for', { 'each' : function(data, index, count) { return data.items; } },
+					['li', { 'class' : 'item' },
+						['b',
 						 	function(data, index, count) { return data; }
 						],
-						": ",
-						["i",
+						': ',
+						['i',
 						 	function(data, index, count) { return index + 1; },
-							" of ",
+							' of ',
 							function(data, index, count) { return count; }
 						]
 					]
 	var actual = view(data).value;
 
 	var expected =
-		["div", { "class" : "list", "style" : "color:blue" },
-			["h2", "This is the title"],
-			["ul",
-				["li", { "class" : "item" },
-					["b", "One"],
-					": ",
-					["i", "1 of 1"]
+		['div', { 'class' : 'list', 'style' : 'color:blue' },
+			['h2', 'This is the title'],
+			['ul',
+				['li', { 'class' : 'item' },
+					['b', 'One'],
+					': ',
+					['i', '1 of 1']
 				]
 			]
 		];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("for-in object", function() {
+test('for-in object', function() {
 	var data = {
-	        name: "List of items",
+	        name: 'List of items',
 	        total: 5,
 	        items: [
-	            "One",
-	            "Two",
-	            "Three",
-	            "Four",
-	            "Five"
+	            'One',
+	            'Two',
+	            'Three',
+	            'Four',
+	            'Five'
 	        ]
 	    };
 
 	var view = duel(
-		["",
-		 	"data => ",
-		 	["dl",
-				["$for", { "in" : function(data) { return data; } },
-				 	["dt",
+		['',
+		 	'data => ',
+		 	['dl',
+				['$for', { 'in' : function(data) { return data; } },
+				 	['dt',
 					 	function(data, index) { return index; },
-					 	" of ",
+					 	' of ',
 					 	function(data, index, count) { return count; },
-					 	" - ",
+					 	' - ',
 					 	function(data, index, count, key) { return key; },
-					 	" : "],
-					["dd",
-					 	"(",
-					 	function(data) { return (data instanceof Array) ? "array" : typeof data; },
-					 	") ",
-					 	function(data) { return "" + data; }
+					 	' : '],
+					['dd',
+					 	'(',
+					 	function(data) { return (data instanceof Array) ? 'array' : typeof data; },
+					 	') ',
+					 	function(data) { return '' + data; }
 				 	]
 			 	]
 		 	]
 	var actual = view(data).value;
 
 	var expected =
-		["",
-		 	"data => ",
-		 	["dl",
-		 	 	["dt", "0 of 3 - name : "],
-		 	 	["dd", "(string) List of items"],
-		 	 	["dt", "1 of 3 - total : "],
-		 	 	["dd", "(number) 5"],
-		 	 	["dt", "2 of 3 - items : "],
-				["dd", "(array) One,Two,Three,Four,Five"]
+		['',
+		 	'data => ',
+		 	['dl',
+		 	 	['dt', '0 of 3 - name : '],
+		 	 	['dd', '(string) List of items'],
+		 	 	['dt', '1 of 3 - total : '],
+		 	 	['dd', '(number) 5'],
+		 	 	['dt', '2 of 3 - items : '],
+				['dd', '(array) One,Two,Three,Four,Five']
 		 	]
 	 	];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("for-count", function() {
+test('for-count', function() {
 	var data = {
-	        name: "List of items",
+	        name: 'List of items',
 	        total: 5,
 	        items: [
-	            "One",
-	            "Two",
-	            "Three",
-	            "Four",
-	            "Five"
+	            'One',
+	            'Two',
+	            'Three',
+	            'Four',
+	            'Five'
 	        ]
 	    };
 
 	var view = duel(
-		["",
-		 	"list => ",
-		 	["dl",
-				["$for", {
-						"count" : function(data, index, count) { return 4; },
-						"data" : function(data, index, count) { return data.name; }
+		['',
+		 	'list => ',
+		 	['dl',
+				['$for', {
+						'count' : function(data, index, count) { return 4; },
+						'data' : function(data, index, count) { return data.name; }
 					},
-				 	["dt",
+				 	['dt',
 					 	function(data, index, count) { return index; },
-					 	" of ",
+					 	' of ',
 					 	function(data, index, count) { return count; },
-					 	": "],
-					["dd",
-					 	function(data, index, count) { return "" + data; }
+					 	': '],
+					['dd',
+					 	function(data, index, count) { return '' + data; }
 				 	]
 			 	]
 		 	]
 	var actual = view(data).value;
 
 	var expected =
-		["",
-		 	"list => ",
-		 	["dl",
-		 	 	["dt", "0 of 4: "],
-		 	 	["dd", "List of items"],
-		 	 	["dt", "1 of 4: "],
-		 	 	["dd", "List of items"],
-		 	 	["dt", "2 of 4: "],
-		 	 	["dd", "List of items"],
-		 	 	["dt", "3 of 4: "],
-				["dd", "List of items"]
+		['',
+		 	'list => ',
+		 	['dl',
+		 	 	['dt', '0 of 4: '],
+		 	 	['dd', 'List of items'],
+		 	 	['dt', '1 of 4: '],
+		 	 	['dd', 'List of items'],
+		 	 	['dt', '2 of 4: '],
+		 	 	['dd', 'List of items'],
+		 	 	['dt', '3 of 4: '],
+				['dd', 'List of items']
 		 	]
 	 	];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("markup data", function() {
+test('markup data', function() {
 
 	var data = {
-	        details: "<blink>Lorem ipsum dolor sit amet</blink>"
+	        details: '<blink>Lorem ipsum dolor sit amet</blink>'
 	    };
 
 	var view = duel(
-		["div", { "class" : "test" },
-			["p",
-			 	"Description: ",
+		['div', { 'class' : 'test' },
+			['p',
+			 	'Description: ',
 			 	function(data, index, count) { return duel.raw(data.details); }
 			]
 		]);
 	var actual = view(data).value;
 
 	var expected = 
-		["div", { "class" : "test" },
-			["p",
-			 	"Description: ",
-			 	duel.raw("<blink>Lorem ipsum dolor sit amet</blink>")
+		['div', { 'class' : 'test' },
+			['p',
+			 	'Description: ',
+			 	duel.raw('<blink>Lorem ipsum dolor sit amet</blink>')
 			]
 		];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("array result", function() {
+test('array result', function() {
 
 	var data = {};
 
 	var view = duel(
-		["p",
+		['p',
 			/* http://stackoverflow.com/questions/4170978 */
-			"Should render \"fuel\" => \"",
+			'Should render "fuel" => "',
 			function() { return ( (![]+[])[+[]]+(!![]+[])[+!+[]+!+[]]+(!![]+[])[+!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]] ); },
-			"\""
+			'"'
 		]);
 
 	var actual = view(data).value;
 
 	var expected = 
-		["p",
-		 	"Should render \"fuel\" => \"fuel\""
+		['p',
+		 	'Should render "fuel" => "fuel"'
 		];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("call view", function() {
+test('call view', function() {
 
 	var data = {
-	        name: "Outer list",
-	        items: ["One", "Two", "Three"]
+	        name: 'Outer list',
+	        items: ['One', 'Two', 'Three']
 	    };
 
 	var Foo = {
 			itemView: duel(
-					["li",
-					 	"data: ",
+					['li',
+					 	'data: ',
 					 	function(data, index, count) { return data; },
-					 	["br"],
-					 	"index: ",
+					 	['br'],
+					 	'index: ',
 					 	function(data, index, count) { return index; },
-					 	["br"],
-					 	"count: ",
+					 	['br'],
+					 	'count: ',
 					 	function(data, index, count) { return count; },
 					]),
 			listView: duel(
-					["div",
-					 	["h2", function(data, index, count) { return data.name; } ],
-						["ul",
-						 	["$for", { "each" : function(data, index, count) { return data.items; } },
-						 		["$call", {
-							 			"view" : function(data, index, count) { return Foo.itemView; },
-							 			"data" :  function(data, index, count) { return data; },
-							 			"index" :  function(data, index, count) { return index; },
-							 			"count" :  function(data, index, count) { return count; }
+					['div',
+					 	['h2', function(data, index, count) { return data.name; } ],
+						['ul',
+						 	['$for', { 'each' : function(data, index, count) { return data.items; } },
+						 		['$call', {
+							 			'view' : function(data, index, count) { return Foo.itemView; },
+							 			'data' :  function(data, index, count) { return data; },
+							 			'index' :  function(data, index, count) { return index; },
+							 			'count' :  function(data, index, count) { return count; }
 						 			}
 						 		]
 						 	]
 	var actual = Foo.listView(data).value;
 
 	var expected = 
-		["div",
-		 	["h2", "Outer list" ],
-			["ul",
-				["li",
-					"data: One",
-					["br"],
-					"index: 0",
-					["br"],
-					"count: 3"
+		['div',
+		 	['h2', 'Outer list' ],
+			['ul',
+				['li',
+					'data: One',
+					['br'],
+					'index: 0',
+					['br'],
+					'count: 3'
 				],
-				["li",
-					"data: Two",
-					["br"],
-					"index: 1",
-					["br"],
-					"count: 3"
+				['li',
+					'data: Two',
+					['br'],
+					'index: 1',
+					['br'],
+					'count: 3'
 				],
-				["li",
-					"data: Three",
-					["br"],
-					"index: 2",
-					["br"],
-					"count: 3"
+				['li',
+					'data: Three',
+					['br'],
+					'index: 2',
+					['br'],
+					'count: 3'
 				]
 			]
 		];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("call wrapper view", function() {
+test('call wrapper view', function() {
 
 	var data = {
-	        name: "Outer list",
-	        items: ["One", "Two", "Three"]
+	        name: 'Outer list',
+	        items: ['One', 'Two', 'Three']
 	    };
 
 	var Foo = {
 			itemView: duel(
-					["li",
-					 	["$part", { "name" : "itemLayout" }]
+					['li',
+					 	['$part', { 'name' : 'itemLayout' }]
 					]),
 			listView: duel(
-					["div",
-					 	["h2", function(data, index, count) { return data.name; } ],
-						["ul",
-						 	["$for", { "each" : function(data, index, count) { return data.items; } },
-						 		["$call", {
-							 			"view" : function(data, index, count) { return Foo.itemView; },
-							 			"data" :  function(data, index, count) { return data; },
-							 			"index" :  function(data, index, count) { return index; },
-							 			"count" :  function(data, index, count) { return count; }
+					['div',
+					 	['h2', function(data, index, count) { return data.name; } ],
+						['ul',
+						 	['$for', { 'each' : function(data, index, count) { return data.items; } },
+						 		['$call', {
+							 			'view' : function(data, index, count) { return Foo.itemView; },
+							 			'data' :  function(data, index, count) { return data; },
+							 			'index' :  function(data, index, count) { return index; },
+							 			'count' :  function(data, index, count) { return count; }
 						 			},
-						 			["$part", { "name" : "itemLayout" },
-						 			 	"data: ",
+						 			['$part', { 'name' : 'itemLayout' },
+						 			 	'data: ',
 									 	function(data, index, count) { return data; },
-									 	["br"],
-									 	"index: ",
+									 	['br'],
+									 	'index: ',
 									 	function(data, index, count) { return index; },
-									 	["br"],
-									 	"count: ",
+									 	['br'],
+									 	'count: ',
 									 	function(data, index, count) { return count; }
 								 	]
 						 		]
 	var actual = Foo.listView(data).value;
 
 	var expected = 
-		["div",
-		 	["h2", "Outer list" ],
-			["ul",
-				["li",
-					"data: One",
-					["br"],
-					"index: 0",
-					["br"],
-					"count: 3"
+		['div',
+		 	['h2', 'Outer list' ],
+			['ul',
+				['li',
+					'data: One',
+					['br'],
+					'index: 0',
+					['br'],
+					'count: 3'
 				],
-				["li",
-					"data: Two",
-					["br"],
-					"index: 1",
-					["br"],
-					"count: 3"
+				['li',
+					'data: Two',
+					['br'],
+					'index: 1',
+					['br'],
+					'count: 3'
 				],
-				["li",
-					"data: Three",
-					["br"],
-					"index: 2",
-					["br"],
-					"count: 3"
+				['li',
+					'data: Three',
+					['br'],
+					'index: 2',
+					['br'],
+					'count: 3'
 				]
 			]
 		];
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
 }catch(ex){alert(ex);}

duel-js/src/test/javascript/domTests.js

 try {
 
-module("Result.toDOM()");
+module('Result.toDOM()');
 
-test("nested elements with attributes", function() {
+test('nested elements with attributes', function() {
 
 	var view = duel(
-		["div", { "class" : "download" },
-			["h2",
-			 	"Filename: Foo.js"
+		['div', { 'class' : 'download' },
+			['h2',
+			 	'Filename: Foo.js'
 			],
-			["p",
-			 	"URL: ",
-			 	["br"],
-			 	["a", { "href" : "http://example.com/foo.js", "target" : "_blank", "title" : "Lorem ipsum dolor sit amet" },
-			 		"http://example.com/foo.js"
+			['p',
+			 	'URL: ',
+			 	['br'],
+			 	['a', { 'href' : 'http://example.com/foo.js', 'target' : '_blank', 'title' : 'Lorem ipsum dolor sit amet' },
+			 		'http://example.com/foo.js'
 		 		],
-			 	" (5.87KB)"
+			 	' (5.87KB)'
 		 	],
-		 	["hr"],
-			["p",
-			 	"Description: Lorem ipsum dolor sit amet"
+		 	['hr'],
+			['p',
+			 	'Description: Lorem ipsum dolor sit amet'
 			]
 		]);
 
 	var actual = view().toDOM();
 
-	var temp, expected = document.createElement("div");
-	expected.className = "download";
+	var temp, expected = document.createElement('div');
+	expected.className = 'download';
 
-	temp = document.createElement("h2");
-	temp.appendChild(document.createTextNode("Filename: Foo.js"));
+	temp = document.createElement('h2');
+	temp.appendChild(document.createTextNode('Filename: Foo.js'));
 	expected.appendChild(temp);
 
-	temp = document.createElement("p");
-	temp.appendChild(document.createTextNode("URL: "));
-	temp.appendChild(document.createElement("br"));
-	var temp2 = document.createElement("a");
-	temp2.setAttribute("href", "http://example.com/foo.js");
-	temp2.setAttribute("target", "_blank");
-	temp2.setAttribute("title", "Lorem ipsum dolor sit amet");
-	temp2.appendChild(document.createTextNode("http://example.com/foo.js"));
+	temp = document.createElement('p');
+	temp.appendChild(document.createTextNode('URL: '));
+	temp.appendChild(document.createElement('br'));
+	var temp2 = document.createElement('a');
+	temp2.setAttribute('href', 'http://example.com/foo.js');
+	temp2.setAttribute('target', '_blank');
+	temp2.setAttribute('title', 'Lorem ipsum dolor sit amet');
+	temp2.appendChild(document.createTextNode('http://example.com/foo.js'));
 	temp.appendChild(temp2);
-	temp.appendChild(document.createTextNode(" (5.87KB)"));
+	temp.appendChild(document.createTextNode(' (5.87KB)'));
 	expected.appendChild(temp);
 
-	expected.appendChild(document.createElement("hr"));
+	expected.appendChild(document.createElement('hr'));
 
-	temp = document.createElement("p");
-	temp.appendChild(document.createTextNode("Description: Lorem ipsum dolor sit amet"));
+	temp = document.createElement('p');
+	temp.appendChild(document.createTextNode('Description: Lorem ipsum dolor sit amet'));
 	expected.appendChild(temp);
 
-	same(toHTML(actual), toHTML(expected), "");
+	same(toHTML(actual), toHTML(expected), '');
 });
 
-test("docFrag root", function() {
+test('docFrag root', function() {
 
 	var view = duel(
-		["",
-		 	["p", "Inner child one."],
-		 	["p", "Inner child two." ]
+		['',
+		 	['p', 'Inner child one.'],
+		 	['p', 'Inner child two.' ]
 		]);
 
 	var actual = view().toDOM();
 
 	var expected = document.createDocumentFragment();
 
-	var temp = document.createElement("p");
-	temp.appendChild(document.createTextNode("Inner child one."));
+	var temp = document.createElement('p');
+	temp.appendChild(document.createTextNode('Inner child one.'));
 	expected.appendChild(temp);
 
-	temp = document.createElement("p");
-	temp.appendChild(document.createTextNode("Inner child two."));
+	temp = document.createElement('p');
+	temp.appendChild(document.createTextNode('Inner child two.'));
 	expected.appendChild(temp);
 
-	same(toHTML(actual), toHTML(expected), "");
+	same(toHTML(actual), toHTML(expected), '');
 });
 
-test("docFrag inner", function() {
+test('docFrag inner', function() {
 
 	var view = duel(
-		["div",
-			["",
-			 	["p", "Inner child one."],
-			 	["p", "Inner child two." ]
+		['div',
+			['',
+			 	['p', 'Inner child one.'],
+			 	['p', 'Inner child two.']
 			]
 		]);
 
 	var actual = view().toDOM();
 
-	var expected = document.createElement("div");
+	var expected = document.createElement('div');
 
-	var temp = document.createElement("p");
-	temp.appendChild(document.createTextNode("Inner child one."));
+	var temp = document.createElement('p');
+	temp.appendChild(document.createTextNode('Inner child one.'));
 	expected.appendChild(temp);
 
-	temp = document.createElement("p");
-	temp.appendChild(document.createTextNode("Inner child two."));
+	temp = document.createElement('p');
+	temp.appendChild(document.createTextNode('Inner child two.'));
 	expected.appendChild(temp);
 
-	same(toHTML(actual), toHTML(expected), "");
+	same(toHTML(actual), toHTML(expected), '');
 });
 
-test("markup data", function() {
+test('markup data', function() {
 
 	var view = duel(
-		["div", { "class" : "test" },
-			["p",
-			 	"Description: ",
-			 	duel.raw("<b>Lorem </b>"),
-			 	duel.raw("<blink>ipsum</blink>"),
-			 	" ",
-			 	duel.raw("<i>dolor sit amet</i>")
+		['div', { 'class' : 'test' },
+			['p',
+			 	'Description: ',
+			 	duel.raw('<b>Lorem </b>'),
+			 	duel.raw('<blink>ipsum</blink>'),
+			 	' ',
+			 	duel.raw('<i>dolor sit amet</i>')
 			]
 		]);
 
 	var actual = view().toDOM();
 
-	var expected = document.createElement("div");
-	expected.className = "test";
+	var expected = document.createElement('div');
+	expected.className = 'test';
 
-	var temp = document.createElement("p");
-	temp.appendChild(document.createTextNode("Description: "));
+	var temp = document.createElement('p');
+	temp.appendChild(document.createTextNode('Description: '));
 
-	var temp2 = document.createElement("div");
-	temp2.innerHTML = "<b>Lorem </b>";
+	var temp2 = document.createElement('div');
+	temp2.innerHTML = '<b>Lorem </b>';
 	while (temp2.firstChild) {
 		temp.appendChild(temp2.firstChild);
 	}
-	temp2.innerHTML = "<blink>ipsum</blink>";
+	temp2.innerHTML = '<blink>ipsum</blink>';
 	while (temp2.firstChild) {
 		temp.appendChild(temp2.firstChild);
 	}
 
-	temp.appendChild(document.createTextNode(" "));
-	temp2.innerHTML = "<i>dolor sit amet</i>";
+	temp.appendChild(document.createTextNode(' '));
+	temp2.innerHTML = '<i>dolor sit amet</i>';
 	while (temp2.firstChild) {
 		temp.appendChild(temp2.firstChild);
 	}
 
 	expected.appendChild(temp);
 
-	same(toHTML(actual), toHTML(expected), "");
+	same(toHTML(actual), toHTML(expected), '');
 });
 
-test("falsey attribute values", function() {
+test('falsey attribute values', function() {
 
 	var view = duel(
-		["div", { "data-str" : "", "data-num" : 0, "data-bool" : false, "data-null" : null, "data-undef" : undefined },
-		 	"Lorem ipsum"
+		['div', { 'data-str' : '', 'data-num' : 0, 'data-bool' : false, 'data-null' : null, 'data-undef' : undefined },
+		 	'Lorem ipsum'
 		]);
 
 	var actual = view().toDOM();
 
-	var expected = document.createElement("div");
-	expected.setAttribute("data-str", "");
-	expected.setAttribute("data-num", 0);
-	expected.setAttribute("data-bool", false);
-	expected.setAttribute("data-null", "");
-	expected.setAttribute("data-undef", "");
-	expected.appendChild(document.createTextNode("Lorem ipsum"));
+	var expected = document.createElement('div');
+	expected.setAttribute('data-str', '');
+	expected.setAttribute('data-num', 0);
+	expected.setAttribute('data-bool', false);
+	expected.setAttribute('data-null', '');
+	expected.setAttribute('data-undef', '');
+	expected.appendChild(document.createTextNode('Lorem ipsum'));
 
-	same(toHTML(actual), toHTML(expected), "");
+	same(toHTML(actual), toHTML(expected), '');
 });
 
-test("comment nodes", function() {
+test('comment nodes', function() {
 
 	var view = duel(
-		["div",
-		 	["!",
-		 	 	"Comment before"],
-		 	"Lorem ipsum",
-		 	["!",
-		 	 	"Comment after"]
+		['div',
+		 	['!',
+		 	 	'Comment before'],
+		 	'Lorem ipsum',
+		 	['!',
+		 	 	'Comment after']
 		]);
 
 	var actual = view().toDOM();
 
-	var expected = document.createElement("div");
-	expected.appendChild(document.createComment("Comment before"));
-	expected.appendChild(document.createTextNode("Lorem ipsum"));
-	expected.appendChild(document.createComment("Comment after"));
+	var expected = document.createElement('div');
+	expected.appendChild(document.createComment('Comment before'));
+	expected.appendChild(document.createTextNode('Lorem ipsum'));
+	expected.appendChild(document.createComment('Comment after'));
 
-	same(toHTML(actual), toHTML(expected), "");
+	same(toHTML(actual), toHTML(expected), '');
 });
 
-test("ignore doctype node", function() {
+test('ignore doctype node', function() {
 
 	var view = duel(
-		["",
-		 	["!DOCTYPE",
-		 	 	"html"],
-	 	 	"\n",
-			["html",
-			 	["body",
-			 	 	"Lorem ipsum."]
+		['',
+		 	['!DOCTYPE',
+		 	 	'html'],
+	 	 	'\n',
+			['html',
+			 	['body',
+			 	 	'Lorem ipsum.']
 			]
 	 	]);
 
 	var actual = view().toDOM();
 
-	var expected = document.createElement("html");
-	var temp = document.createElement("body");
-	temp.appendChild(document.createTextNode("Lorem ipsum."));
+	var expected = document.createElement('html');
+	var temp = document.createElement('body');
+	temp.appendChild(document.createTextNode('Lorem ipsum.'));
 	expected.appendChild(temp);
 
-	same(toHTML(actual), toHTML(expected), "");
+	same(toHTML(actual), toHTML(expected), '');
 });
 
-test("deferred attribute binding", function() {
+test('deferred attribute binding', function() {
 
 	var attrs = {
-		"class" : function() { return "hello"; },
-		"data-foo" : function() { return "foo"; }
+		'class' : function() { return 'hello'; },
+		'data-foo' : function() { return 'foo'; }
 	};
 
-	var id = "__"+new Date().valueOf();
+	var id = '__'+new Date().valueOf();
 
-	var expected = document.createElement("div");
-	expected.setAttribute("id", id);
-	expected.appendChild(document.createTextNode("Lorem ipsum"));
-	expected.setAttribute("class", "hello");
-	expected.setAttribute("data-foo", "foo");
+	var expected = document.createElement('div');
+	expected.setAttribute('id', id);
+	expected.appendChild(document.createTextNode('Lorem ipsum'));
+	expected.setAttribute('class', 'hello');
+	expected.setAttribute('data-foo', 'foo');
 
-	var actual = document.createElement("div");
-	actual.setAttribute("id", id);
-	actual.appendChild(document.createTextNode("Lorem ipsum"));
+	var actual = document.createElement('div');
+	actual.setAttribute('id', id);
+	actual.appendChild(document.createTextNode('Lorem ipsum'));
 
 	duel.attr(actual, attrs);
 	
-	same(toHTML(actual), toHTML(expected), "");
+	same(toHTML(actual), toHTML(expected), '');
 });
 
 }catch(ex){alert(ex);}

duel-js/src/test/javascript/renderTests.js

 try {
 
-module("Result.toString()");
+module('Result.toString()');
 
-test("nested elements with attributes", function() {
+test('nested elements with attributes', function() {
 
 	var view = duel(
-		["div", { "class" : "download" },
-			["h2",
-			 	"Filename: Foo.js"
+		['div', { 'class' : 'download' },
+			['h2',
+			 	'Filename: Foo.js'
 			],
-			["p",
-			 	"URL: ",
-			 	["br"],
-			 	["a", { "href" : "http://example.com/foo.js", "target" : "_blank", "title" : "Lorem ipsum dolor sit amet" },
-			 		"http://example.com/foo.js"
+			['p',
+			 	'URL: ',
+			 	['br'],
+			 	['a', { 'href' : 'http://example.com/foo.js', 'target' : '_blank', 'title' : 'Lorem ipsum dolor sit amet' },
+			 		'http://example.com/foo.js'
 		 		],
-			 	" (5.87KB)"
+			 	' (5.87KB)'
 		 	],
-		 	["hr"],
-			["p",
-			 	"Description: Lorem ipsum dolor sit amet"
+		 	['hr'],
+			['p',
+			 	'Description: Lorem ipsum dolor sit amet'
 			]
 		]);
 
 		'<p>Description: Lorem ipsum dolor sit amet</p>'+
 		'</div>';
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("native toString", function() {
+test('native toString', function() {
 
 	var view = duel(
-		["div", { "class" : "download" },
-			["h2",
-			 	"Filename: Foo.js"
+		['div', { 'class' : 'download' },
+			['h2',
+			 	'Filename: Foo.js'
 			],
-			["p",
-			 	"URL: ",
-			 	["br"],
-			 	["a", { "href" : "http://example.com/foo.js", "target" : "_blank", "title" : "Lorem ipsum dolor sit amet" },
-			 		"http://example.com/foo.js"
+			['p',
+			 	'URL: ',
+			 	['br'],
+			 	['a', { 'href' : 'http://example.com/foo.js', 'target' : '_blank', 'title' : 'Lorem ipsum dolor sit amet' },
+			 		'http://example.com/foo.js'
 		 		],
-			 	" (5.87KB)"
+			 	' (5.87KB)'
 		 	],
-		 	["hr"],
-			["p",
-			 	"Description: Lorem ipsum dolor sit amet"
+		 	['hr'],
+			['p',
+			 	'Description: Lorem ipsum dolor sit amet'
 			]
 		]);
 
-	var actual = ""+view();
+	var actual = ''+view();
 
 	var expected =
 		'<div class="download"><h2>Filename: Foo.js</h2>'+
 		'<p>Description: Lorem ipsum dolor sit amet</p>'+
 		'</div>';
 
-	same(actual, expected, "");
+	same(actual, expected, '');
 });
 
-test("innerHTML toString", function() {
+test('innerHTML toString', function() {
 
 	var view = duel(
-		["div", { "class" : "download" },
-			["h2",