Skip to content

Commit

Permalink
Fix 'not optimized' warning in Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
t-mw committed Feb 13, 2017
1 parent 3a9e30c commit 1619ba1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/lua.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,14 @@ Lua.State = function (_L) {
// Auxiliary library takes precedence
(function() {
function wrap(func) {
return function() {
var args = slice.call(arguments, 0);
args.splice(0, 0, this._L);
return func.apply(null, args);
};
return(function() {
var args = [this._L];
var l = arguments.length;
for (var i = 0; i < l; i++) {
args.push(arguments[i]);
}
return func.apply(null, args)
})
}
for (var i in Lua.lib) {
Lua.State.prototype[i] = wrap(Lua.lib[i]);
Expand Down

0 comments on commit 1619ba1

Please sign in to comment.