chakra-core / chakra-core/ChakraCore

JSRT APIs JsConvertValueToString and JsGetProperty fail if the input value is taggedInt instead of Object

Open
#660 10 comments 0 reactions 0 assignees View on GitHub
Bug Severity: 3
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

We are incorrectly treating taggedInt as JavascriptNumber.

Same as [OS 6980708](https://microsoft.visualstudio.com/web/wi.aspx?pcguid=cb55739e-4afe-46a3-970f-1b49d8ee7564&id=6980708)

**Details from the bug above:**

I was trying to convert something to a string in an external function. Instead of calling JsConvertValueToString, I tried to get the "toString" method and call it.

```
MyExternalFunction(..., JsValueRef *pArguments, ...)
{
...
JsGetProperty(pArguments[...], propIdToString, &jsToString);
...
}
```

fails with `JsErrorArgumentNotObject` when I call it on `TaggedInt`.

I can do this for string conversion:
`host.externalFunction()`

I cannot do this:
`host.externalFunction(42)`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.