aboutsummaryrefslogtreecommitdiff
path: root/src/lauxlib.js
blob: 3ff346e74beeb41840b475b72a97307e333fbb8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*jshint esversion: 6 */
"use strict";

const assert = require('assert');

const lstate = require('./lstate.js');
const lapi   = require('./lapi.js');

const panic = function(L) {
    console.log(`PANIC: unprotected error in call to Lua API (...)`);
    return 0;
}

const luaL_newstate = function() {
    let L = lstate.lua_newstate();
    if (L) lapi.lua_atpanic(L, panic);
    return L;
};


module.exports.luaL_newstate = luaL_newstate;