Resolved JsCreateString & JsPointerToString #6669
Since I am new to Open-Source, I picked this issue. Following the instructions, I have:
-
Changed the SAL annotation for the string input parameter from In to In_opt, I also read up relevant documentation for the same which helped in understanding NULL Value handling.
-
I have also changed the implementation, added the test cases & updated the comments in the headers which mention that 0 lengths will ignore the input string pointer and return a Js empty string.
-
The Added test cases that were previously not working are working now.
-
I also glanced through the active contributions for the same issue by @dagarxji, and tried to solve the last issue raised by @rhuanjl regarding the PERFORM_JSRT_TTD_RECORD_ACTION macro & checked in case it is inside an if-conditional.
-
I spent a majority of my time understanding Chakra & the code-flow, the thought behind has been really instructional. Already loving the inclusivity of the community.
Thanks for having a go at this.
Having a look through this looks incomplete at the moment.
There are 3 APIs you've looked at, for each one we need:
- header SAL annotation change
- header comments update
- implementation (JSRT.cpp) SAL annotation update
- implementation logic update - to handle the stringLength=0 case
- test update
Taking them in turn, it currently looks like you've done:
| API | header SAL | header comments | implementation SAL | implementation logic | test |
|---|---|---|---|---|---|
| JsCreateString | yes | yes | yes | yes | |
| JsCreateStringUTF16 | yes | ||||
| JsPointerToString | yes | yes | yes | yes | yes |
Please let me know if you need any further help.
Hi @rhuanjl, Thank you for the prompt response. Will work to rectify the issues pointed out now!