Change raw string length calculation method (#3772)

New method uses length of source to calculate raw string length.

Also bug with template literal was fixed. Template object should have
indexed properties enumerable.

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
This commit is contained in:
Rafal Walczyna
2020-05-22 10:11:47 +02:00
committed by GitHub
parent 87b1d1eeb0
commit 5d6069176b
3 changed files with 28 additions and 18 deletions
@@ -126,3 +126,14 @@ assert (String.raw`Hi\n${2+3}!` === "Hi\\n5!");
var localNew = new getStr();
assert(chainedCall === getStr() && chainedCall === localNew);
})();
var templateObject;
(function(p) {
templateObject = p;
})`str`;
var desc = Object.getOwnPropertyDescriptor(templateObject, '0');
assert(desc.writable === false);
assert(desc.enumerable === true);
assert(desc.configurable === false);