Skip to content

Commit

Permalink
Added doc and win creation with .use/.u
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Oct 1, 2012
1 parent e8c1f3d commit f185b11
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/repl.js
Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f185b11

Please sign in to comment.