-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
implement string.match(regexp) #131
Conversation
Thanks, im just looking into the benchmarks issue so bear with me |
I've made some changes to the benchmarks Action, could you try rebasing and pushing again? |
The benchmarks still failed. |
Ugh... |
src/lib/js/string.rs
Outdated
let slots = &*obj.borrow().internal_slots; | ||
if slots.get("RegExpMatcher").is_some() { |
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.
You could use .get_internal_slot() here, which gives you either the value or undefined
.
You will always get a value back so be careful here.
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 you also want to handle the case where RegExpMatcher isn't there.
(An object was passed but it wasn't a RegExp)
src/lib/js/string.rs
Outdated
if let Some(flags) = slots.get("OriginalFlags") { | ||
regex_flags = from_value(flags.clone()).unwrap(); | ||
} | ||
} |
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.
You could probably just return undefined here if RegExpMatcher isn't there
Hi, should I move the core functionality to |
Yeap, although we don't have support for Symbols yet. |
Yes. I will. I'll push the update over the weekend. |
PR updated |
This is really awesome, thanks so much, looks clean and the tests are great |
an implementation of strings.match from issue #114