fix sublime plugin issue with ui mode, object prototype pollution, try for ui api
This commit is contained in:
@@ -13,12 +13,13 @@ if(__engine_name__ == "rhino"){
|
||||
}
|
||||
}
|
||||
|
||||
var __that__ = this;
|
||||
|
||||
var __asGlobal__ = function(obj, functions){
|
||||
var len = functions.length;
|
||||
for(var i = 0; i < len; i++) {
|
||||
var funcName = functions[i];
|
||||
this[funcName] = obj[funcName].bind(obj);
|
||||
__that__[funcName] = obj[funcName].bind(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +33,4 @@ require("__general__")(__runtime__, this);
|
||||
var m = modules[i];
|
||||
scope[m] = require('__' + m + '__')(scope.__runtime__, scope);
|
||||
}
|
||||
})(this);
|
||||
})(__that__);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
module.exports = function(__runtime__, scope){
|
||||
var app = new Object(__runtime__.app);
|
||||
var app = Object.create(__runtime__.app);
|
||||
var context = scope.context;
|
||||
|
||||
app.intent = function(i) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
module.exports = function(__runtime__, scope){
|
||||
var console = new Object(__runtime__.console);
|
||||
var console = Object.create(__runtime__.console);
|
||||
|
||||
console.assert = function(value, message){
|
||||
message = message || "";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module.exports = function(__runtime__, scope){
|
||||
var ui = Object(__runtime__.ui);
|
||||
ui.layout = function(xml){
|
||||
view = ui.inflate(xml);
|
||||
view = ui.inflate(activity, xml);
|
||||
ui.setView(view);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user