diff options
Diffstat (limited to 'js/src/Ice/browser/WSEndpointFactory.js')
-rw-r--r-- | js/src/Ice/browser/WSEndpointFactory.js | 71 |
1 files changed, 33 insertions, 38 deletions
diff --git a/js/src/Ice/browser/WSEndpointFactory.js b/js/src/Ice/browser/WSEndpointFactory.js index 7b6ab3b9094..8e371302801 100644 --- a/js/src/Ice/browser/WSEndpointFactory.js +++ b/js/src/Ice/browser/WSEndpointFactory.js @@ -7,42 +7,37 @@ // // ********************************************************************** -(function(global){ - require("Ice/Class"); - require("Ice/Endpoint"); - require("Ice/browser/WSEndpoint"); - - var Ice = global.Ice || {}; - - var WSEndpoint = Ice.WSEndpoint; - var WSEndpointFactory = Ice.Class({ - __init__:function(instance, secure) - { - this._instance = instance; - this._secure = secure; - }, - type: function() - { - return this._secure ? Ice.WSSEndpointType : Ice.WSEndpointType; - }, - protocol: function() - { - return this._secure ? "wss" : "ws"; - }, - create: function(str, oaEndpoint) - { - return WSEndpoint.fromString(this._instance, this._secure, str, oaEndpoint); - }, - read: function(s) - { - return WSEndpoint.fromStream(s, this._secure); - }, - destroy: function() - { - this._instance = null; - } - }); - Ice.WSEndpointFactory = WSEndpointFactory; - global.Ice = Ice; -}(typeof (global) === "undefined" ? window : global)); +var Ice = require("../Ice/ModuleRegistry").Ice; +Ice.__M.require(module, "Ice", ["../Ice/Class", "../Ice/Endpoint", "../Ice/browser/WSEndpoint"]); + +var WSEndpoint = Ice.WSEndpoint; + +var WSEndpointFactory = Ice.Class({ + __init__:function(instance, secure) + { + this._instance = instance; + this._secure = secure; + }, + type: function() + { + return this._secure ? Ice.WSSEndpointType : Ice.WSEndpointType; + }, + protocol: function() + { + return this._secure ? "wss" : "ws"; + }, + create: function(str, oaEndpoint) + { + return WSEndpoint.fromString(this._instance, this._secure, str, oaEndpoint); + }, + read: function(s) + { + return WSEndpoint.fromStream(s, this._secure); + }, + destroy: function() + { + this._instance = null; + } +}); +Ice.WSEndpointFactory = WSEndpointFactory; |