1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-05 00:49:00 +02:00

New type system (#232)

* New type system

* Fixed dot notation for HTML elements
This commit is contained in:
Tim Voronov
2019-02-13 12:31:18 -05:00
committed by GitHub
parent b3bcbda3b9
commit 1af8b37a0f
185 changed files with 1379 additions and 820 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/runtime/values"
"github.com/MontFerret/ferret/pkg/runtime/values/types"
)
// MergeRecursive recursively merge the given objects into a single object.
@ -17,7 +18,7 @@ func MergeRecursive(_ context.Context, args ...core.Value) (core.Value, error) {
}
for _, arg := range args {
if err = core.ValidateType(arg, core.ObjectType); err != nil {
if err = core.ValidateType(arg, types.Object); err != nil {
return values.None, err
}
}
@ -36,7 +37,7 @@ func merge(src, dst core.Value) core.Value {
return dst
}
if src.Type() != core.ObjectType {
if src.Type() != types.Object {
return dst
}