Skip to content

Commit 1619ba1

Browse files
committed
Fix 'not optimized' warning in Chrome
See: GoogleChrome/devtools-docs#53 (comment)
1 parent 3a9e30c commit 1619ba1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/lua.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,14 @@ Lua.State = function (_L) {
396396
// Auxiliary library takes precedence
397397
(function() {
398398
function wrap(func) {
399-
return function() {
400-
var args = slice.call(arguments, 0);
401-
args.splice(0, 0, this._L);
402-
return func.apply(null, args);
403-
};
399+
return(function() {
400+
var args = [this._L];
401+
var l = arguments.length;
402+
for (var i = 0; i < l; i++) {
403+
args.push(arguments[i]);
404+
}
405+
return func.apply(null, args)
406+
})
404407
}
405408
for (var i in Lua.lib) {
406409
Lua.State.prototype[i] = wrap(Lua.lib[i]);

0 commit comments

Comments
 (0)