ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

Resolved JsCreateString & JsPointerToString #6669

Open RahulSharma-10 opened this issue 4 years ago • 2 comments

Since I am new to Open-Source, I picked this issue. Following the instructions, I have:

  1. 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.

  2. 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.

  3. The Added test cases that were previously not working are working now.

  4. 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.

  5. 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.

RahulSharma-10 avatar Aug 30 '21 22:08 RahulSharma-10

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.

rhuanjl avatar Aug 31 '21 06:08 rhuanjl

Hi @rhuanjl, Thank you for the prompt response. Will work to rectify the issues pointed out now!

RahulSharma-10 avatar Aug 31 '21 11:08 RahulSharma-10