apply plugin retrolambda

This commit is contained in:
hyb1996
2017-10-19 15:34:51 +08:00
parent 7c4f3b37a3
commit 4b43434b25
54 changed files with 707 additions and 778 deletions

View File

@@ -1,15 +1,16 @@
module.exports = function(__runtime__, scope){
scope.files = com.stardust.pio.PFile;
var files = com.stardust.pio.PFiles;
scope.files = files;
scope.open = function(path, mode, encoding, bufferSize){
if(arguments.length == 1){
return com.stardust.pio.PFile.open(path);
return files.open(path);
}else if(arguments.length == 2){
return com.stardust.pio.PFile.open(path, mode);
return files.open(path, mode);
}else if(arguments.length == 3){
return com.stardust.pio.PFile.open(path, mode, encoding);
return files.open(path, mode, encoding);
}else if(arguments.length == 4){
return com.stardust.pio.PFile.open(path, mode, encoding, bufferSize);
return files.open(path, mode, encoding, bufferSize);
}
};

View File

@@ -1,46 +0,0 @@
var __require__ = require;
var __nodejs_modules__ = {
'websocket' : com.iwebpp.wspp.WebSocket,
'websocketserver': com.iwebpp.wspp.WebSocketServer,
'net': com.iwebpp.node.net.TCP,
'tcp': com.iwebpp.node.net.TCP,
'udt': com.iwebpp.node.net.UDT,
'readable': com.iwebpp.node.stream.Readable2,
'writable': com.iwebpp.node.stream.Writable2,
'duplex': com.iwebpp.node.stream.Duplex,
'transform': com.iwebpp.node.stream.Transform,
'passthrough': com.iwebpp.node.stream.PassThrough,
'dns': com.iwebpp.node.Dns,
'url': com.iwebpp.node.Url,
}
var require = function(module){
if (module === 'http'){
return {
get: function(url, listener){
return com.iwebpp.node.http.http.get(NodeCurrentContext, url, listener);
},
request: function(url, listener) {
return com.iwebpp.node.http.http.request(NodeCurrentContext, url, listener);
},
createServer: function(listener) {
return com.iwebpp.node.http.http.createServer(NodeCurrentContext, listener);
},
};
}
if (module === 'httpp'){
return {
get: function(url, listener){
return com.iwebpp.node.http.httpp.get(NodeCurrentContext, url, listener);
},
request: function(url, listener) {
return com.iwebpp.node.http.httpp.request(NodeCurrentContext, url, listener);
},
createServer: function(listener) {
return com.iwebpp.node.http.httpp.createServer(NodeCurrentContext, listener);
},
};
}
return __require__(module);
};