JSMessage::kUnknownMethod and kTooManyOccurances are XFA-Only.
Save a few bytes in non-xfa case by excluding string equivalents.
Change-Id: I2ff57388b491ae7342ee39a9a626420371b55dad
Reviewed-on: https://pdfium-review.googlesource.com/c/44892
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/js_resources.cpp b/fxjs/js_resources.cpp
index 29edf89..6edb768 100644
--- a/fxjs/js_resources.cpp
+++ b/fxjs/js_resources.cpp
@@ -49,12 +49,14 @@
return L"Object no longer exists.";
case JSMessage::kObjectTypeError:
return L"Object is of the wrong type.";
- case JSMessage::kTooManyOccurances:
- return L"Too many occurances.";
case JSMessage::kUnknownProperty:
return L"Unknown property.";
+#ifdef PDF_ENABLE_XFA
+ case JSMessage::kTooManyOccurances:
+ return L"Too many occurances.";
case JSMessage::kUnknownMethod:
return L"Unknown method.";
+#endif
}
NOTREACHED();
return L"";
diff --git a/fxjs/js_resources.h b/fxjs/js_resources.h
index 064fd16..576fba5 100644
--- a/fxjs/js_resources.h
+++ b/fxjs/js_resources.h
@@ -30,9 +30,11 @@
kPermissionError,
kBadObjectError,
kObjectTypeError,
- kTooManyOccurances,
kUnknownProperty,
+#ifdef PDF_ENABLE_XFA
+ kTooManyOccurances,
kUnknownMethod,
+#endif
};
WideString JSGetStringFromID(JSMessage msg);