Permalink
Browse files

merge master up to level2

  • Loading branch information...
2 parents 25684b4 + 40791ad commit 39b921da3d320a3923460d96541d1d5f8a2baf02 @tmpvar committed Jun 24, 2010
@@ -1,8 +1,8 @@
var sys = require('sys');
-var dom = require('../../lib/level1/core').dom.level1.core;
-var browser = require('../../lib/browser/index').windowAugmentation(dom);
+var dom = require('../../lib/jsdom/level1/core').dom.level1.core;
+var browser = require('../../lib/jsdom/browser/index').windowAugmentation(dom);
var document = browser.document;
var window = browser.window;
View
@@ -1,22 +1,17 @@
-var sys = require("sys"), fs = require("fs");
+var sys = require("sys"), fs = require("fs");
-var dom = require("../../lib/level1/core").dom.level1.core;
-var window = require("../../lib/browser").windowAugmentation(dom).window;
-var document = window.document;
-var location = window.location;
-var navigator = window.navigator;
+var dom = require("../../lib/jsdom/level1/core").dom.level1.core;
+var window = require("../../lib/jsdom/browser").windowAugmentation(dom).window;
+var Script = process.binding('evals').Script;
fs.readFile(__dirname + "/jquery.js", function(err, data) {
-
+
try {
- eval(data.toString());
- } catch (e) {
- sys.puts(sys.inspect(e.stack, true));
+ Script.runInNewContext(data.toString(), {window: window, location: window.location, navigator: window.navigator});
+ } catch(e){
+ sys.puts(sys.inspect(e));
}
-
- // Doing this requires you setup a parser, easiest way is to put node-htmlparser.js into
- // ~/.node_libraries/
-
- window.jQuery(document.body).append("<div class='testing'>Hello World, It works!</div>");
+ window.jQuery('body').append("<div class='testing'>Hello World, It works!</div>");
sys.puts(window.jQuery(".testing").text());
+
});
View
@@ -1,5 +1,5 @@
var sys = require('sys');
-process.mixin(GLOBAL, require("../../lib/level1/core").dom.level1.core);
+process.mixin(GLOBAL, require("../../lib/jsdom/level1/core").dom.level1.core);
// git clone git://github.com/robrighter/node-xml.git into ~/.node_libraries
var xml = require("node-xml/lib/node-xml");
View
@@ -1,5 +1,5 @@
-var browser = require("../../lib/browser");
-var dom = new browser.browserAugmentation(require("../../lib/level1/core").dom.level1.core);
+var browser = require("../../lib/jsdom/browser");
+var dom = new browser.browserAugmentation(require("../../lib/jsdom/level1/core").dom.level1.core);
var sax = require("./sax");
var sys = require("sys");
@@ -63,21 +63,21 @@ dom.Element.prototype.__defineSetter__('innerHTML', function(html) {
var doc = new dom.Document("html");
-var implementation = new dom.DOMImplementation(doc, {
- "HTML" : "1.0",
- "DisableLiveLists" : "1.0"
-});
-
-var notations = new dom.NotationNodeMap(
- doc,
- doc.createNotationNode("notation1","notation1File", null),
- doc.createNotationNode("notation2",null, "notation2File")
-);
-
-var entities = new dom.EntityNodeMap(doc);
-
-var doctype = new dom.DocumentType(doc, "html", entities, notations);
-doc.doctype = doctype;
+var implementation = new dom.DOMImplementation(doc, {
+ "HTML" : "1.0",
+ "DisableLiveLists" : "1.0"
+});
+
+var notations = new dom.NotationNodeMap(
+ doc,
+ doc.createNotationNode("notation1","notation1File", null),
+ doc.createNotationNode("notation2",null, "notation2File")
+);
+
+var entities = new dom.EntityNodeMap(doc);
+
+var doctype = new dom.DocumentType(doc, "html", entities, notations);
+doc.doctype = doctype;
doc.implementation = implementation;
doc.innerHTML = '<html><head></head><body><div class="who"></div></body></html>';
View
@@ -1,5 +1,5 @@
-var browser = require("../../lib/browser");
-var dom = browser.browserAugmentation(require("../../lib/level1/core").dom.level1.core);
+var browser = require("../../lib/jsdom/browser");
+var dom = browser.browserAugmentation(require("../../lib/jsdom/level1/core").dom.level1.core);
var sys = require("sys");
View
@@ -1,4 +1,4 @@
// TODO: add on other levels
-exports.dom = require(__dirname + "/level1/core").dom;
-exports.browserAugmentation = require(__dirname + "/browser").browserAugmentation;
+exports.dom = require("./jsdom/level1/core").dom;
+exports.browserAugmentation = require("./jsdom/browser").browserAugmentation;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
-var core = require(__dirname + "/../level1/core").dom.level1.core;
+var core = require("../level1/core").dom.level1.core;
var INVALID_STATE_ERR = core.INVALID_STATE_ERR = 11;
var SYNTAX_ERR = core.SYNTAX_ERR = 12
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -20,7 +20,7 @@ var mixin = function(target) {
return target;
};
-mixin(global, require("../lib/level1/core").dom.level1.core);
+mixin(global, require("../lib/jsdom/level1/core").dom.level1.core);
mixin(global, require(__dirname + "/mjsunit"));
mixin(global, require("./DOMTestCase"));
@@ -73,16 +73,16 @@ var suites = {
}
},
"level2/core" : { cases: require("./level2/core").tests, setUp : function() {
- mixin(global, require("../lib/level2/core").dom.level2.core);
+ mixin(global, require("../lib/jsdom/level2/core").dom.level2.core);
global.builder.contentType = "text/xml";
global.builder.type = "xml";
global.builder.testDirectory = "level2/core";
}
},
"browser" : { cases: require("./browser").tests, setUp : function() {
- global.dom = require(__dirname + "/../lib/level1/core").dom.level1.core;
- global.browser = require(__dirname + "/../lib/browser").browserAugmentation(dom);
+ global.dom = require(__dirname + "/../lib/jsdom/level1/core").dom.level1.core;
+ global.browser = require(__dirname + "/../lib/jsdom/browser").browserAugmentation(dom);
global.builder.contentType = "text/html";
@@ -91,8 +91,8 @@ var suites = {
}
},
"window" : { cases: require("./window").tests, setUp : function() {
- global.dom = require(__dirname + "/../lib/level1/core").dom.level1.core;
- global.window = require(__dirname + "/../lib/browser").windowAugmentation(dom);
+ global.dom = require(__dirname + "/../lib/jsdom/level1/core").dom.level1.core;
+ global.window = require(__dirname + "/../lib/jsdom/browser").windowAugmentation(dom);
global.builder.contentType = "text/html";

0 comments on commit 39b921d

Please sign in to comment.