mirror of
https://github.com/google/go-jsonnet.git
synced 2025-08-07 23:07:14 +02:00
match change to cpp version re: unrecognized native returning null
This commit is contained in:
parent
c038cd37e7
commit
b4603b0c32
@ -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)
|
||||||
|
11
testdata/native_nonexistent.golden
vendored
11
testdata/native_nonexistent.golden
vendored
@ -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
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user