haikuwebkit/LayoutTests/js/dom/string-prototype-scopes.html

11 lines
236 B
HTML
Raw Permalink Normal View History

[JSC] Drop isEnvironmentRecord type info flag and use JSType information instead https://bugs.webkit.org/show_bug.cgi?id=163761 Reviewed by Keith Miller. JSTests: * modules/string-prototype-module-scope.js: Added. (shouldBe): (catch): (refer): * stress/string-prototype-scopes-global-lexical-environment-strict.js: Added. (shouldBe): (catch): * stress/string-prototype-scopes-global-lexical-environment.js: Added. (shouldBe): (catch): * stress/string-prototype-scopes-strict.js: Added. (shouldBe): (catch): (try.refer): (refer): * stress/string-prototype-scopes.js: Added. (shouldBe): (catch): (try.refer): (refer): (object.toString): (with): Source/JavaScriptCore: When we call a function in the following form, var charAt = String.prototype.charAt; charAt(); // |this| becomes the global object. we should see |this| as undefined/null. In StringPrototype.cpp, we use IsEnvironmentRecord type info flag to check whther the given |this| is an environment record. However, type info flag is precious thing and only StringPrototype.cpp uses IsEnvironmentRecord. In addition to that, JSType should already knows whether the given object is an environment record. So IsEnvironmentRecord type info flag should be dropped. This patch adds a new JSType, StrictEvalActivation. And we add a new method JSObject::isEnvironmentRecord(). This method uses JSType to return the result. And we drop IsEnvironmentRecord type info flag. This patch makes a room for putting one bit flag to the out of line type info flag. Previously, it is already exhausted. * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LowLevelInterpreter.asm: * runtime/JSObject.h: (JSC::JSObject::isStrictEvalActivation): (JSC::JSObject::isEnvironmentRecord): * runtime/JSSymbolTableObject.h: * runtime/JSType.h: * runtime/JSTypeInfo.h: (JSC::TypeInfo::newImpurePropertyFiresWatchpoints): (JSC::TypeInfo::isEnvironmentRecord): Deleted. * runtime/StrictEvalActivation.h: (JSC::StrictEvalActivation::createStructure): * runtime/StringPrototype.cpp: (JSC::checkObjectCoercible): LayoutTests: * js/dom/script-tests/string-prototype-scopes-in-workers.js: Added. (catch): * js/dom/script-tests/string-prototype-scopes.js: Added. (catch): * js/dom/string-prototype-scopes-expected.txt: Added. * js/dom/string-prototype-scopes-in-workers-expected.txt: Added. * js/dom/string-prototype-scopes-in-workers.html: Added. * js/dom/string-prototype-scopes.html: Added. Canonical link: https://commits.webkit.org/181536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-21 01:33:14 +00:00
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script src="script-tests/string-prototype-scopes.js"></script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>