-
Notifications
You must be signed in to change notification settings - Fork 469
Improve output of Dict.has
to use inlined JS' in
operator
#7342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
358f372
f8963e5
04fd8e0
ec99f26
63563c7
7467e76
02b5699
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
// Generated by ReScript, PLEASE EDIT WITH CARE | ||
|
||
import * as Stdlib_Dict from "rescript/lib/es6/Stdlib_Dict.js"; | ||
|
||
let someString = "hello"; | ||
|
||
|
@@ -43,40 +42,76 @@ let PatternMatching = { | |
}; | ||
|
||
let dict = { | ||
key1: 1, | ||
key1: false, | ||
key2: undefined | ||
}; | ||
|
||
if (Stdlib_Dict.has(dict, "key1") !== true) { | ||
if (!("key1" in dict)) { | ||
throw { | ||
RE_EXN_ID: "Assert_failure", | ||
_1: [ | ||
"DictTests.res", | ||
43, | ||
44, | ||
2 | ||
], | ||
Error: new Error() | ||
}; | ||
} | ||
|
||
if (Stdlib_Dict.has(dict, "key2") !== true) { | ||
if (!("key2" in dict)) { | ||
throw { | ||
RE_EXN_ID: "Assert_failure", | ||
_1: [ | ||
"DictTests.res", | ||
44, | ||
46, | ||
2 | ||
], | ||
Error: new Error() | ||
}; | ||
} | ||
|
||
if ("key3" in dict !== false) { | ||
throw { | ||
RE_EXN_ID: "Assert_failure", | ||
_1: [ | ||
"DictTests.res", | ||
48, | ||
2 | ||
], | ||
Error: new Error() | ||
}; | ||
} | ||
|
||
if ("toString" in dict !== false) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did this pass? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll double check. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. This file wasn't running in the test suite, since it wasn't ending with |
||
throw { | ||
RE_EXN_ID: "Assert_failure", | ||
_1: [ | ||
"DictTests.res", | ||
50, | ||
2 | ||
], | ||
Error: new Error() | ||
}; | ||
} | ||
|
||
if (!("key1" in dict)) { | ||
throw { | ||
RE_EXN_ID: "Assert_failure", | ||
_1: [ | ||
"DictTests.res", | ||
52, | ||
2 | ||
], | ||
Error: new Error() | ||
}; | ||
} | ||
|
||
if (Stdlib_Dict.has(dict, "key3") !== false) { | ||
if (typeof ("key1" in dict) !== "boolean") { | ||
throw { | ||
RE_EXN_ID: "Assert_failure", | ||
_1: [ | ||
"DictTests.res", | ||
45, | ||
54, | ||
2 | ||
], | ||
Error: new Error() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changelog should be updated