Skip to content

Commit

Permalink
Minor fixes (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
arduano authored Apr 29, 2024
1 parent af43fae commit 5b1d18b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
5 changes: 0 additions & 5 deletions nixjs-rt/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,6 @@ function _recursiveDisjointMerge(
function _assertIsMergeable(value: NixType, attrPath: string[]): Attrset {
const valueStrict = value.toStrict();
if (!(valueStrict instanceof Attrset)) {
// FIXME: Is this error relevant? I'm not sure why it was here, but I'll leave it as a comment
// throw new EvalException(
// `Attribute '${attrPath.join(".")}' already defined.`,
// );

throw typeMismatchError(
valueStrict,
Attrset,
Expand Down
28 changes: 14 additions & 14 deletions src/tests/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ fn eval_string_operator_errors() {
);

// FIXME: It says string instead of int, because nixjs flips the operator. Should we address?
// assert_eq!(
// eval_err("\"hello\" < 123"),
// NixErrorKind::TypeMismatch {
// expected: vec![],
// got: NixTypeKind::Int
// }
// );
assert_eq!(
eval_err("\"hello\" < 123"),
NixErrorKind::TypeMismatch {
expected: vec![],
got: NixTypeKind::String
}
);
assert_eq!(
eval_err("\"hello\" > 123"),
NixErrorKind::TypeMismatch {
Expand All @@ -212,13 +212,13 @@ fn eval_string_operator_errors() {
}
);
// FIXME: It says string instead of int, because nixjs flips the operator. Should we address?
// assert_eq!(
// eval_err("\"hello\" >= 123"),
// NixErrorKind::TypeMismatch {
// expected: vec![],
// got: NixTypeKind::Int
// }
// );
assert_eq!(
eval_err("\"hello\" >= 123"),
NixErrorKind::TypeMismatch {
expected: vec![],
got: NixTypeKind::String
}
);
}

#[test]
Expand Down

0 comments on commit 5b1d18b

Please sign in to comment.