convertEnumerationToJS() should not stash ASCIILiteral strings in NeverDestroyed...
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 20:34:47 +0000 (20:34 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 20:34:47 +0000 (20:34 +0000)
commit33e59ee3a6c37b5f40c5deb7261c07c5928aae85
treeaaa1e12708ec5e31d5bf07330f657268a980b62b
parentf2a0c742864f39bd41853f6f4222569b3ceee02c
convertEnumerationToJS() should not stash ASCIILiteral strings in NeverDestroyed arrays.
https://bugs.webkit.org/show_bug.cgi?id=172724
<rdar://problem/31193201>

Reviewed by Chris Dumez.

Use MAKE_STATIC_STRING_IMPL instead, which is guaranteed to be thread-safe and
satisfies the promise of immortality promised by NeverDestroyed (while ASCIILiteral
does not always satisfy this promise).

Also converted the ASSERT in convertEnumerationToJS() to a RELEASE_ASSERT as a
debugging aid to check if it is ever passed an invalid enumerationValue.

No new tests because this is a speculative fix for an issue observed in the wild
whose root cause is not known yet.  This patch also adds a release assert to
gather more info about the nature of the issue.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumerationImplementationContent):

* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::convertEnumerationToJS):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertEnumerationToJS):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertEnumerationToJS):
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
(WebCore::convertEnumerationToJS):
- re-baselined these test results.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp