How to use the js-slang/dist/createContext.defineBuiltin function in js-slang

To help you get started, we’ve selected a few js-slang examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github source-academy / cadet-frontend / src / utils / slangHelper.ts View on Github external
function loadStandardLibraries(proxyContext: Context, customBuiltIns: CustomBuiltIns) {
  importBuiltins(proxyContext, customBuiltIns);
  defineBuiltin(proxyContext, 'makeUndefinedErrorFunction', (fname: string) => () => {
    throw new Error(`Name ${fname} not declared.`);
  });
}