[21476] Ensure "the extents of tArray" returns empty when keys are not integers - #6636
Conversation
|
@livecodepanos : So this patch isn't quite correct... If you add a test (which we need for this anyway) - then you'll find that: Will result in tArray having extents - when they should be empty. I think we need to MCNumberParseInteger() or similar, which fails if a string is anything other than one matching the pattern |
| MC_DLLEXPORT bool MCNumberParseOffsetPartial(MCStringRef p_string, uindex_t offset, uindex_t &r_chars_used, MCNumberRef &r_number); | ||
|
|
||
| MC_DLLEXPORT bool MCNumberParseOffset(MCStringRef p_string, uindex_t offset, uindex_t char_count, MCNumberRef &r_number); | ||
| MC_DLLEXPORT bool MCNumberParseOffset(MCStringRef p_string, uindex_t offset, uindex_t char_count, bool p_integer_only, MCNumberRef &r_number); |
There was a problem hiding this comment.
Is there a reason you've added the flag to the public function? We have to be careful changing anything which is MC_DLLEXPORT as it could be bound to by an LCB module.
There was a problem hiding this comment.
Currently MCNumberParseOffset is called in MCNumberParse and MCNumberParseInteger, so I added the flag to differentiate between these 2. But I could do so by calling the private __MCNumberParseOffset instead, so I'll change this.
|
@livecode-vulcan review ok 7254625 |
|
💙 review by @runrevmark ok 7254625 |
[21476] Ensure "the extents of tArray" returns empty when keys are not integers
|
😎 test success 7254625
|
No description provided.