* Updated addErrorContext.
This commit is contained in:
parent
e2d5e40f4f
commit
83d7b89660
1 changed files with 7 additions and 6 deletions
|
@ -189,19 +189,20 @@ static void prim_throw(EvalState & state, Value * * args, Value & v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void prim_addErrorContext(EvalState & state, Value * * args, Value & v)
|
static void prim_addErrorContext(EvalState & state, Value * * args, Value & v)
|
||||||
{
|
{
|
||||||
PathSet context;
|
|
||||||
try {
|
try {
|
||||||
return evalExpr(state, args[1]);
|
state.forceValue(*args[1]);
|
||||||
|
v = *args[1];
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
e.addPrefix(format("%1%\n") %
|
PathSet context;
|
||||||
evalString(state, args[0], context));
|
e.addPrefix(format("%1%\n") % state.coerceToString(*args[0], context));
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Try evaluating the argument. Success => {success=true; value=something;},
|
/* Try evaluating the argument. Success => {success=true; value=something;},
|
||||||
* else => {success=false; value=false;} */
|
* else => {success=false; value=false;} */
|
||||||
static void prim_tryEval(EvalState & state, Value * * args, Value & v)
|
static void prim_tryEval(EvalState & state, Value * * args, Value & v)
|
||||||
|
@ -1060,8 +1061,8 @@ void EvalState::createBaseEnv()
|
||||||
addPrimOp("__genericClosure", 1, prim_genericClosure);
|
addPrimOp("__genericClosure", 1, prim_genericClosure);
|
||||||
addPrimOp("abort", 1, prim_abort);
|
addPrimOp("abort", 1, prim_abort);
|
||||||
addPrimOp("throw", 1, prim_throw);
|
addPrimOp("throw", 1, prim_throw);
|
||||||
#if 0
|
|
||||||
addPrimOp("__addErrorContext", 2, prim_addErrorContext);
|
addPrimOp("__addErrorContext", 2, prim_addErrorContext);
|
||||||
|
#if 0
|
||||||
addPrimOp("__tryEval", 1, prim_tryEval);
|
addPrimOp("__tryEval", 1, prim_tryEval);
|
||||||
#endif
|
#endif
|
||||||
addPrimOp("__getEnv", 1, prim_getEnv);
|
addPrimOp("__getEnv", 1, prim_getEnv);
|
||||||
|
|
Loading…
Reference in a new issue