Title: [207852] trunk/Source/_javascript_Core
- Revision
- 207852
- Author
- [email protected]
- Date
- 2016-10-25 15:41:09 -0700 (Tue, 25 Oct 2016)
Log Message
Remove redundant argument count check
Indexing argument out of bounds already returns jsUndefined().
Remove redundant argument count check
https://bugs.webkit.org/show_bug.cgi?id=163957
Reviewed by Keith Miller.
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
(JSC::Interpreter::callErrorConstructor):
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (207851 => 207852)
--- trunk/Source/_javascript_Core/ChangeLog 2016-10-25 22:30:08 UTC (rev 207851)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-10-25 22:41:09 UTC (rev 207852)
@@ -1,3 +1,20 @@
+2016-10-25 JF Bastien <[email protected]>
+
+ Remove redundant argument count check
+
+ Indexing argument out of bounds already returns jsUndefined().
+
+ Remove redundant argument count check
+ https://bugs.webkit.org/show_bug.cgi?id=163957
+
+ Reviewed by Keith Miller.
+
+ * runtime/ErrorConstructor.cpp:
+ (JSC::Interpreter::constructWithErrorConstructor):
+ (JSC::Interpreter::callErrorConstructor):
+ * wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
+ (JSC::constructJSWebAssemblyRuntimeError):
+
2016-10-25 Mark Lam <[email protected]>
Add ThrowScope::release() calls at all call sites of jsMakeNontrivialString().
Modified: trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp (207851 => 207852)
--- trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp 2016-10-25 22:30:08 UTC (rev 207851)
+++ trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp 2016-10-25 22:41:09 UTC (rev 207852)
@@ -52,7 +52,7 @@
{
VM& vm = exec->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
- JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
+ JSValue message = exec->argument(0);
Structure* errorStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), asInternalFunction(exec->callee())->globalObject()->errorStructure());
RETURN_IF_EXCEPTION(scope, encodedJSValue());
return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
@@ -66,7 +66,7 @@
EncodedJSValue JSC_HOST_CALL Interpreter::callErrorConstructor(ExecState* exec)
{
- JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
+ JSValue message = exec->argument(0);
Structure* errorStructure = asInternalFunction(exec->callee())->globalObject()->errorStructure();
return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
}
Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp (207851 => 207852)
--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp 2016-10-25 22:30:08 UTC (rev 207851)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp 2016-10-25 22:41:09 UTC (rev 207852)
@@ -48,7 +48,7 @@
{
auto& vm = state->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
- JSValue message = state->argumentCount() ? state->argument(0) : jsUndefined();
+ JSValue message = state->argument(0);
auto* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), asInternalFunction(state->callee())->globalObject()->WebAssemblyRuntimeErrorStructure());
RETURN_IF_EXCEPTION(scope, encodedJSValue());
return JSValue::encode(JSWebAssemblyRuntimeError::create(state, structure, message, false));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes