Title: [260057] trunk/Source/_javascript_Core
Revision
260057
Author
[email protected]
Date
2020-04-13 20:05:21 -0700 (Mon, 13 Apr 2020)

Log Message

REGRESSION (r259587): bterlson/eshost throws during init in strict mode
https://bugs.webkit.org/show_bug.cgi?id=210470

Reviewed by Ross Kirsling.

This change makes $262.IsHTMLDDA of JSC shell a CustomValue, allowing it to be reassigned
and restoring compatibility with any version of https://github.com/bterlson/eshost.

Since putDirectCustomAccessor() is now used instead of putGetter(), scope exception assert
is no longer needed and can be safely removed, as well as JSObject::putGetter() export.

* jsc.cpp:
* runtime/JSObject.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (260056 => 260057)


--- trunk/Source/_javascript_Core/ChangeLog	2020-04-14 02:59:30 UTC (rev 260056)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-04-14 03:05:21 UTC (rev 260057)
@@ -1,3 +1,19 @@
+2020-04-13  Alexey Shvayka  <[email protected]>
+
+        REGRESSION (r259587): bterlson/eshost throws during init in strict mode
+        https://bugs.webkit.org/show_bug.cgi?id=210470
+
+        Reviewed by Ross Kirsling.
+
+        This change makes $262.IsHTMLDDA of JSC shell a CustomValue, allowing it to be reassigned
+        and restoring compatibility with any version of https://github.com/bterlson/eshost.
+
+        Since putDirectCustomAccessor() is now used instead of putGetter(), scope exception assert
+        is no longer needed and can be safely removed, as well as JSObject::putGetter() export.
+
+        * jsc.cpp:
+        * runtime/JSObject.h:
+
 2020-04-13  David Kilzer  <[email protected]>
 
         Replace use of Checked<size_t, RecordOverflow> with CheckedSize

Modified: trunk/Source/_javascript_Core/jsc.cpp (260056 => 260057)


--- trunk/Source/_javascript_Core/jsc.cpp	2020-04-14 02:59:30 UTC (rev 260056)
+++ trunk/Source/_javascript_Core/jsc.cpp	2020-04-14 03:05:21 UTC (rev 260057)
@@ -486,7 +486,6 @@
 protected:
     void finishCreation(VM& vm, const Vector<String>& arguments)
     {
-        auto catchScope = DECLARE_CATCH_SCOPE(vm);
         Base::finishCreation(vm);
 
         addFunction(vm, "debug", functionDebug, 1);
@@ -597,11 +596,13 @@
         addFunction(vm, dollar, "evalScript", functionDollarEvalScript, 1);
         
         dollar->putDirect(vm, Identifier::fromString(vm, "global"), this);
+        dollar->putDirectCustomAccessor(vm, Identifier::fromString(vm, "IsHTMLDDA"),
+            CustomGetterSetter::create(vm, [](JSGlobalObject* globalObject, EncodedJSValue, PropertyName) {
+                return functionMakeMasquerader(globalObject, nullptr);
+            }, nullptr),
+            static_cast<unsigned>(PropertyAttribute::CustomValue)
+        );
 
-        JSFunction* IsHTMLDDAGetter = JSFunction::create(vm, this, 0, "IsHTMLDDA"_s, functionMakeMasquerader);
-        dollar->putGetter(this, Identifier::fromString(vm, "IsHTMLDDA"), IsHTMLDDAGetter, static_cast<unsigned>(PropertyAttribute::Accessor));
-        catchScope.releaseAssertNoException();
-
         JSObject* agent = JSFinalObject::create(vm, plainObjectStructure);
         dollar->putDirect(vm, Identifier::fromString(vm, "agent"), agent);
         

Modified: trunk/Source/_javascript_Core/runtime/JSObject.h (260056 => 260057)


--- trunk/Source/_javascript_Core/runtime/JSObject.h	2020-04-14 02:59:30 UTC (rev 260056)
+++ trunk/Source/_javascript_Core/runtime/JSObject.h	2020-04-14 03:05:21 UTC (rev 260057)
@@ -607,7 +607,7 @@
     bool putDirectAccessor(JSGlobalObject*, PropertyName, GetterSetter*, unsigned attributes);
     JS_EXPORT_PRIVATE bool putDirectCustomAccessor(VM&, PropertyName, JSValue, unsigned attributes);
 
-    JS_EXPORT_PRIVATE bool putGetter(JSGlobalObject*, PropertyName, JSValue, unsigned attributes);
+    bool putGetter(JSGlobalObject*, PropertyName, JSValue, unsigned attributes);
     bool putSetter(JSGlobalObject*, PropertyName, JSValue, unsigned attributes);
 
     JS_EXPORT_PRIVATE bool hasProperty(JSGlobalObject*, PropertyName) const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to