Remove class_name argument from JSSpecialProp methods
It is always passed as "global".
-- update TODO() to match current impl.
Change-Id: I185db2c577318ac9b7b87df4852a1346600b4a57
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/66131
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index e5df506..925b665 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -29,8 +29,7 @@
return WideString::FromUTF8(ByteStringView(*utf8_value, utf8_value.length()));
}
-void JSSpecialPropQuery(const char*,
- v8::Local<v8::String> property,
+void JSSpecialPropQuery(v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Integer>& info) {
auto pObj = JSGetObject<CJS_Global>(info.Holder());
if (!pObj)
@@ -46,8 +45,7 @@
info.GetReturnValue().Set(!result.HasError() ? 4 : 0);
}
-void JSSpecialPropGet(const char* class_name,
- v8::Local<v8::String> property,
+void JSSpecialPropGet(v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
auto pObj = JSGetObject<CJS_Global>(info.Holder());
if (!pObj)
@@ -62,15 +60,14 @@
if (result.HasError()) {
pRuntime->Error(
- JSFormatErrorString(class_name, "GetProperty", result.Error()));
+ JSFormatErrorString("global", "GetProperty", result.Error()));
return;
}
if (result.HasReturn())
info.GetReturnValue().Set(result.Return());
}
-void JSSpecialPropPut(const char* class_name,
- v8::Local<v8::String> property,
+void JSSpecialPropPut(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
auto pObj = JSGetObject<CJS_Global>(info.Holder());
@@ -86,12 +83,11 @@
if (result.HasError()) {
pRuntime->Error(
- JSFormatErrorString(class_name, "PutProperty", result.Error()));
+ JSFormatErrorString("global", "PutProperty", result.Error()));
}
}
-void JSSpecialPropDel(const char* class_name,
- v8::Local<v8::String> property,
+void JSSpecialPropDel(v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Boolean>& info) {
auto pObj = JSGetObject<CJS_Global>(info.Holder());
if (!pObj)
@@ -103,10 +99,11 @@
CJS_Result result = pObj->DelProperty(
pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
+
if (result.HasError()) {
// TODO(dsinclair): Should this set the pRuntime->Error result?
- // ByteString cbName =
- // ByteString::Format("%s.%s", class_name, "DelProperty");
+ // pRuntime->Error(
+ // JSFormatErrorString("global", "DelProperty", result.Error());
}
}
@@ -141,7 +138,6 @@
const v8::PropertyCallbackInfo<v8::Integer>& info) {
ASSERT(property->IsString());
JSSpecialPropQuery(
- "global",
v8::Local<v8::String>::New(info.GetIsolate(),
GetV8StringFromProperty(property, info)),
info);
@@ -153,7 +149,6 @@
const v8::PropertyCallbackInfo<v8::Value>& info) {
ASSERT(property->IsString());
JSSpecialPropGet(
- "global",
v8::Local<v8::String>::New(info.GetIsolate(),
GetV8StringFromProperty(property, info)),
info);
@@ -166,7 +161,6 @@
const v8::PropertyCallbackInfo<v8::Value>& info) {
ASSERT(property->IsString());
JSSpecialPropPut(
- "global",
v8::Local<v8::String>::New(info.GetIsolate(),
GetV8StringFromProperty(property, info)),
value, info);
@@ -178,7 +172,6 @@
const v8::PropertyCallbackInfo<v8::Boolean>& info) {
ASSERT(property->IsString());
JSSpecialPropDel(
- "global",
v8::Local<v8::String>::New(info.GetIsolate(),
GetV8StringFromProperty(property, info)),
info);