Permalink
Browse files

Added doc and win creation with .use/.u

  • Loading branch information...
1 parent e8c1f3d commit f185b1199198cc46019de409c3ab4c44a3867aed @davglass committed Oct 1, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/repl.js
View
@@ -44,7 +44,6 @@ exports.startPrompt = function(Y, YUI) {
var ctx = repl.context;
ctx.Y = Y;
ctx.YUI = YUI;
-
var clear = function(write) {
this.outputStream.write('Resetting Y to the default state'.magenta);
this.bufferedCommand = '';
@@ -180,6 +179,12 @@ exports.startPrompt = function(Y, YUI) {
var args = l.split(',');
this.outputStream.write('Using modules: '.magenta + l);
this.context.Y.applyConfig({ useSync: true });
+ var document = jsdom.jsdom('<!doctype html><html><title></title><body></body></html>');
+ var window = document.createWindow();
+ this.context.Y.applyConfig({
+ win: window,
+ doc: document
+ });
this.context.Y.use.apply(this.context.Y, args);
this.outputStream.write(' [done]\n'.white);
this.displayPrompt();

0 comments on commit f185b11

Please sign in to comment.