Permalink
Browse files

Previous fix for document.write was incomplete, this one works

better.
  • Loading branch information...
1 parent 19a9ffb commit f4800b42d0034ea39512ee2a98d2fdfd168ec484 @assaf assaf committed Dec 28, 2010
Showing with 16 additions and 4 deletions.
  1. +8 −0 CHANGELOG.md
  2. +1 −1 package.json
  3. +7 −3 src/zombie/jsdom_patches.coffee
View
@@ -1,6 +1,14 @@
zombie.js changelog(1) -- Changelog
===================================
+## Version 0.7.5 2010-12-28
+
+Previous fix for document.write was incomplete, this one works better.
+
+ 189 Tests
+ 2.5 sec to complete
+
+
## Version 0.7.4 2010-12-28
Now parsing documents using HTML5, which can deal better with tag soup.
View
@@ -1,6 +1,6 @@
{
"name": "zombie",
- "version": "0.7.4",
+ "version": "0.7.5",
"description": "Insanely fast, full-stack, headless testing using node.js",
"homepage": "http://zombie.labnotes.org/",
"author": "Assaf Arkin <assaf@labnotes.org> (http://labnotes.org/)",
@@ -138,14 +138,18 @@ core.CharacterData.prototype.__defineGetter__ "_nodeValue", -> @_text
core.Document.prototype._elementBuilders["script"] = (doc, s)->
script = new core.HTMLScriptElement(doc, s)
script.addEventListener "DOMCharacterDataModified", (event)->
- code = event.target.nodeValue.trim()
- if code.length > 0
+ code = event.target.nodeValue
+ if code.trim().length > 0
src = this.sourceLocation || {}
filename = src.file || this.ownerDocument.URL
if src
filename += ':' + src.line + ':' + src.col
filename += '<script>'
- core.resourceLoader.enqueue(this, this._eval, filename)(null, code)
+ eval = (text, filename)->
+ if text + " " == this.text
+ core.languageProcessors[this.language](this, text, filename)
+ process.nextTick =>
+ core.resourceLoader.enqueue(this, eval, filename)(null, code)
# Fix text property so it doesn't fail on empty contents
script.__defineGetter__ "text", ->
# Handle script with no child elements, but also force script

0 comments on commit f4800b4

Please sign in to comment.