match change to cpp version re: unrecognized native returning null

This commit is contained in:
Dave Cunningham 2018-07-18 20:55:57 -04:00
parent c038cd37e7
commit b4603b0c32
2 changed files with 2 additions and 13 deletions

View File

@ -795,10 +795,8 @@ func builtinNative(i *interpreter, trace TraceElement, name value) (value, error
index := str.getString() index := str.getString()
if f, exists := i.nativeFuncs[index]; exists { if f, exists := i.nativeFuncs[index]; exists {
return &valueFunction{ec: f}, nil return &valueFunction{ec: f}, nil
} }
return nil, i.Error(fmt.Sprintf("Unrecognized native function name: %v", index), trace) return &valueNull{}, nil
} }
type unaryBuiltinFunc func(*interpreter, TraceElement, value) (value, error) type unaryBuiltinFunc func(*interpreter, TraceElement, value) (value, error)

View File

@ -1,10 +1 @@
RUNTIME ERROR: Unrecognized native function name: blah null
-------------------------------------------------
testdata/native_nonexistent:1:1-19 builtin function <native>
std.native("blah")
-------------------------------------------------
During evaluation