mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
Do the WebKit upgrade
This commit is contained in:
Submodule src/bun.js/WebKit updated: a310140b2d...a0e19fa370
@@ -16,7 +16,6 @@
|
||||
#include "JavaScriptCore/CallFrameInlines.h"
|
||||
#include "JavaScriptCore/ClassInfo.h"
|
||||
#include "JavaScriptCore/CodeBlock.h"
|
||||
#include "JavaScriptCore/CodeCache.h"
|
||||
#include "JavaScriptCore/Completion.h"
|
||||
#include "JavaScriptCore/Error.h"
|
||||
#include "JavaScriptCore/ErrorInstance.h"
|
||||
|
||||
@@ -49,9 +49,8 @@ void BundlerPlugin::NamespaceList::append(JSC::VM& vm, JSC::RegExp* filter, Stri
|
||||
|
||||
Yarr::RegularExpression regex(
|
||||
StringView(filter->pattern()),
|
||||
filter->flags().contains(Yarr::Flags::IgnoreCase) ? Yarr::TextCaseSensitivity::TextCaseInsensitive : Yarr::TextCaseSensitivity::TextCaseInsensitive,
|
||||
filter->multiline() ? Yarr::MultilineMode::MultilineEnabled : Yarr::MultilineMode::MultilineDisabled,
|
||||
filter->eitherUnicode() ? Yarr::UnicodeMode::UnicodeAwareMode : Yarr::UnicodeMode::UnicodeUnawareMode);
|
||||
filter->flags());
|
||||
|
||||
nsGroup->append(WTFMove(regex));
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "JavaScriptCore/JSFunctionInlines.h"
|
||||
#include "JavaScriptCore/JSGlobalObjectInlines.h"
|
||||
#include "JavaScriptCore/JSObjectInlines.h"
|
||||
#include "JavaScriptCore/JSProxy.h"
|
||||
#include "JavaScriptCore/JSGlobalProxy.h"
|
||||
#include "JavaScriptCore/JSString.h"
|
||||
#include "JavaScriptCore/Operations.h"
|
||||
#include "JavaScriptCore/SlotVisitorInlines.h"
|
||||
|
||||
@@ -22,8 +22,8 @@ JSClass* toJSDOMGlobalObject(JSC::VM& vm, JSC::JSValue value)
|
||||
// static_assert(std::is_base_of_v<JSDOMGlobalObject, JSClass>);
|
||||
|
||||
if (auto* object = value.getObject()) {
|
||||
if (object->type() == JSC::PureForwardingProxyType)
|
||||
return JSC::jsDynamicCast<JSClass*>(JSC::jsCast<JSC::JSProxy*>(object)->target());
|
||||
if (object->type() == JSC::GlobalProxyType)
|
||||
return JSC::jsDynamicCast<JSClass*>(JSC::jsCast<JSC::JSGlobalProxy*>(object)->target());
|
||||
if (object->inherits<JSClass>())
|
||||
return JSC::jsCast<JSClass*>(object);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "JavaScriptCore/CallFrameInlines.h"
|
||||
#include "JavaScriptCore/ClassInfo.h"
|
||||
#include "JavaScriptCore/CodeBlock.h"
|
||||
#include "JavaScriptCore/CodeCache.h"
|
||||
#include "JavaScriptCore/Completion.h"
|
||||
#include "JavaScriptCore/Error.h"
|
||||
#include "JavaScriptCore/ErrorInstance.h"
|
||||
@@ -992,11 +991,7 @@ static JSC_DEFINE_HOST_FUNCTION(functionATOB,
|
||||
return JSC::JSValue::encode(JSC::jsEmptyString(vm));
|
||||
}
|
||||
|
||||
auto decodedData = WTF::base64Decode(encodedString, {
|
||||
WTF::Base64DecodeOptions::ValidatePadding,
|
||||
WTF::Base64DecodeOptions::IgnoreSpacesAndNewLines,
|
||||
WTF::Base64DecodeOptions::DiscardVerticalTab,
|
||||
});
|
||||
auto decodedData = WTF::base64Decode(encodedString, Base64DecodeMode::DefaultValidatePaddingAndIgnoreWhitespace);
|
||||
if (!decodedData) {
|
||||
auto scope = DECLARE_THROW_SCOPE(globalObject->vm());
|
||||
throwException(globalObject, scope, createDOMException(globalObject, ExceptionCode::InvalidCharacterError));
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "ZigSourceProvider.h"
|
||||
|
||||
#include "JavaScriptCore/BytecodeCacheError.h"
|
||||
#include "JavaScriptCore/CodeCache.h"
|
||||
|
||||
#include "JavaScriptCore/Completion.h"
|
||||
#include "wtf/Scope.h"
|
||||
|
||||
@@ -2894,7 +2894,7 @@ pub const JSValue = enum(JSValueReprInt) {
|
||||
BooleanObject,
|
||||
NumberObject,
|
||||
ErrorInstance,
|
||||
PureForwardingProxy,
|
||||
GlobalProxy,
|
||||
DirectArguments,
|
||||
ScopedArguments,
|
||||
ClonedArguments,
|
||||
|
||||
@@ -1377,7 +1377,7 @@ pub const ZigConsoleClient = struct {
|
||||
};
|
||||
}
|
||||
|
||||
if (js_type == .PureForwardingProxy) {
|
||||
if (js_type == .GlobalProxy) {
|
||||
return Tag.get(
|
||||
JSC.JSValue.c(JSC.C.JSObjectGetProxyTarget(value.asObjectRef())),
|
||||
globalThis,
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "JavaScriptCore/CallFrameInlines.h"
|
||||
#include "JavaScriptCore/ClassInfo.h"
|
||||
#include "JavaScriptCore/CodeBlock.h"
|
||||
#include "JavaScriptCore/CodeCache.h"
|
||||
#include "JavaScriptCore/Completion.h"
|
||||
#include "JavaScriptCore/Error.h"
|
||||
#include "JavaScriptCore/ErrorInstance.h"
|
||||
@@ -61,7 +60,7 @@ namespace Napi {
|
||||
|
||||
JSC::SourceCode generateSourceCode(WTF::String keyString, JSC::VM& vm, JSC::JSObject* object, JSC::JSGlobalObject* globalObject)
|
||||
{
|
||||
JSC::JSArray* exportKeys = ownPropertyKeys(globalObject, object, PropertyNameMode::StringsAndSymbols, DontEnumPropertiesMode::Include, std::nullopt);
|
||||
JSC::JSArray* exportKeys = ownPropertyKeys(globalObject, object, PropertyNameMode::StringsAndSymbols, DontEnumPropertiesMode::Include);
|
||||
JSC::Identifier ident = JSC::Identifier::fromString(vm, "__BunTemporaryGlobal"_s);
|
||||
WTF::StringBuilder sourceCodeBuilder = WTF::StringBuilder();
|
||||
// TODO: handle symbol collision
|
||||
@@ -268,7 +267,7 @@ static void defineNapiProperty(Zig::GlobalObject* globalObject, JSC::JSObject* t
|
||||
if (getterProperty) {
|
||||
JSC::JSNativeStdFunction* getterFunction = JSC::JSNativeStdFunction::create(
|
||||
globalObject->vm(), globalObject, 0, String(), [getterProperty](JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame) -> JSC::EncodedJSValue {
|
||||
JSC::MarkedArgumentBufferWithSize values;
|
||||
JSC::MarkedArgumentBuffer values;
|
||||
values.append(callFrame->thisValue());
|
||||
return getterProperty(globalObject, callFrame);
|
||||
});
|
||||
@@ -284,7 +283,7 @@ static void defineNapiProperty(Zig::GlobalObject* globalObject, JSC::JSObject* t
|
||||
if (setterProperty) {
|
||||
JSC::JSNativeStdFunction* setterFunction = JSC::JSNativeStdFunction::create(
|
||||
globalObject->vm(), globalObject, 1, String(), [setterProperty](JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame) -> JSC::EncodedJSValue {
|
||||
JSC::MarkedArgumentBufferWithSize values;
|
||||
JSC::MarkedArgumentBuffer values;
|
||||
values.append(callFrame->thisValue());
|
||||
values.append(callFrame->uncheckedArgument(0));
|
||||
return setterProperty(globalObject, callFrame);
|
||||
@@ -1348,7 +1347,7 @@ extern "C" napi_status napi_get_all_property_names(
|
||||
return NAPI_OBJECT_EXPECTED;
|
||||
}
|
||||
|
||||
JSC::JSArray* exportKeys = ownPropertyKeys(globalObject, object, jsc_property_mode, jsc_key_mode, std::nullopt);
|
||||
JSC::JSArray* exportKeys = ownPropertyKeys(globalObject, object, jsc_property_mode, jsc_key_mode);
|
||||
// TODO: filter
|
||||
*result = toNapi(JSC::JSValue::encode(exportKeys));
|
||||
return napi_ok;
|
||||
@@ -1455,7 +1454,7 @@ extern "C" napi_status napi_get_property_names(napi_env env, napi_value object,
|
||||
|
||||
auto scope = DECLARE_CATCH_SCOPE(vm);
|
||||
JSC::EnsureStillAliveScope ensureStillAlive(jsValue);
|
||||
JSC::JSValue value = JSC::ownPropertyKeys(globalObject, jsValue.getObject(), PropertyNameMode::Strings, DontEnumPropertiesMode::Include, std::nullopt);
|
||||
JSC::JSValue value = JSC::ownPropertyKeys(globalObject, jsValue.getObject(), PropertyNameMode::Strings, DontEnumPropertiesMode::Include);
|
||||
if (UNLIKELY(scope.exception())) {
|
||||
*result = reinterpret_cast<napi_value>(JSC::JSValue::encode(JSC::jsUndefined()));
|
||||
return napi_generic_failure;
|
||||
|
||||
@@ -202,7 +202,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionIsSharedArrayBuffer, (JSC::JSGlobalObject * g
|
||||
JSC_DEFINE_HOST_FUNCTION(jsFunctionIsProxy, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callframe))
|
||||
{
|
||||
GET_FIRST_CELL
|
||||
return JSValue::encode(jsBoolean(cell->type() == PureForwardingProxyType || cell->type() == ProxyObjectType));
|
||||
return JSValue::encode(jsBoolean(cell->type() == GlobalProxyType || cell->type() == ProxyObjectType));
|
||||
}
|
||||
JSC_DEFINE_HOST_FUNCTION(jsFunctionIsModuleNamespaceObject, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callframe))
|
||||
{
|
||||
|
||||
@@ -1505,7 +1505,7 @@ JSC_DEFINE_CUSTOM_GETTER(jsSqlStatementGetColumnNames, (JSGlobalObject * lexical
|
||||
}
|
||||
JSC::JSArray* array;
|
||||
if (castedThis->columnNames->size() > 0) {
|
||||
array = ownPropertyKeys(lexicalGlobalObject, castedThis->_prototype.get(), PropertyNameMode::Strings, DontEnumPropertiesMode::Exclude, CachedPropertyNamesKind::Keys);
|
||||
array = ownPropertyKeys(lexicalGlobalObject, castedThis->_prototype.get(), PropertyNameMode::Strings, DontEnumPropertiesMode::Exclude);
|
||||
} else {
|
||||
array = JSC::constructEmptyArray(lexicalGlobalObject, nullptr, 0);
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ pub const CellType = enum(u8) {
|
||||
BooleanObjectType = 28,
|
||||
NumberObjectType = 29,
|
||||
ErrorInstanceType = 30,
|
||||
PureForwardingProxyType = 31,
|
||||
GlobalProxyType = 31,
|
||||
DirectArgumentsType = 32,
|
||||
ScopedArgumentsType = 33,
|
||||
ClonedArgumentsType = 34,
|
||||
|
||||
@@ -443,7 +443,7 @@ pub const JestPrettyFormat = struct {
|
||||
};
|
||||
}
|
||||
|
||||
if (js_type == .PureForwardingProxy) {
|
||||
if (js_type == .GlobalProxy) {
|
||||
return Tag.get(
|
||||
JSC.JSValue.c(JSC.C.JSObjectGetProxyTarget(value.asObjectRef())),
|
||||
globalThis,
|
||||
|
||||
Reference in New Issue
Block a user