Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: test/cctest/test-api.cc

Issue 854363003: fix debug checks for api callbacks returning symbols (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 9611ddb991ad7846fa9af70ed53fc6c2bee9f8fc..9b3bd3ddbc157cfe4e4283f929638dff136fbd3c 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -23648,6 +23648,32 @@ TEST(FunctionCallOptimizationMultipleArgs) {
}
+static void ReturnsSymbolCallback(
+ const v8::FunctionCallbackInfo<v8::Value>& info) {
+ info.GetReturnValue().Set(v8::Symbol::New(info.GetIsolate()));
+}
+
+
+TEST(ApiCallbackCanReturnSymbols) {
+ i::FLAG_allow_natives_syntax = true;
+ LocalContext context;
+ v8::Isolate* isolate = context->GetIsolate();
+ v8::HandleScope scope(isolate);
+ Handle<Object> global = context->Global();
+ Local<v8::Function> function = Function::New(isolate, ReturnsSymbolCallback);
+ global->Set(v8_str("x"), function);
+ CompileRun(
+ "function x_wrap() {\n"
+ " for (var i = 0; i < 5; i++) {\n"
+ " x();\n"
+ " }\n"
+ "}\n"
+ "x_wrap();\n"
+ "%OptimizeFunctionOnNextCall(x_wrap);"
+ "x_wrap();\n");
+}
+
+
static const char* last_event_message;
static int last_event_status;
void StoringEventLoggerCallback(const char* message, int status) {
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698