Skip to content

Commit

Permalink
Don't create window.WebServer.
Browse files Browse the repository at this point in the history
It was done for WebPage for backward compatibility and it would be
removed in the future, so don't do it for WebServer.

http://code.google.com/p/phantomjs/issues/detail?id=115
  • Loading branch information
ariya committed Dec 23, 2011
1 parent 1ee0a4c commit cbc9be0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/bootstrap.js
Expand Up @@ -55,4 +55,3 @@ function require(name) {

// Legacy way to use WebPage
window.WebPage = require('webpage').create;
window.WebServer = require('webserver').create;
9 changes: 5 additions & 4 deletions test/webserver-spec.js
@@ -1,10 +1,11 @@
describe("WebServer constructor", function() {
it("should exist in window", function() {
expect(window.hasOwnProperty('WebServer')).toBeTruthy();
it("should not exist in window", function() {
expect(window.hasOwnProperty('WebServer')).toBeFalsy();
});

it("should be a function", function() {
expect(typeof window.WebServer).toEqual('function');
var WebServer = require('webserver').create;
expect(typeof WebServer).toEqual('function');
});
});

Expand All @@ -31,7 +32,7 @@ function checkRequest(request, response) {
}

describe("WebServer object", function() {
var server = new WebServer();
var server = require('webserver').create();

it("should be creatable", function() {
expect(typeof server).toEqual('object');
Expand Down

0 comments on commit cbc9be0

Please sign in to comment.