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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1419273008: [Interpreter] Add support for new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_thisfunc
Patch Set: Created 5 years, 1 month 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/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-bytecode-generator.cc
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
index 631e6a902b69673b45094e15a1b3d88f75e5a26d..71564f52cf454c748783a928148da80738905a2b 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -5188,6 +5188,32 @@ TEST(ThisFunction) {
}
}
+
+TEST(NewTarget) {
+ InitializedHandleScope handle_scope;
+ BytecodeGeneratorHelper helper;
+
+ ExpectedSnippet<int> snippets[] = {
+ {"return new.target;",
+ 1 * kPointerSize,
+ 1,
+ 10,
+ {
+ B(CallRuntime), U16(Runtime::kGetOriginalConstructor), R(0), //
+ U8(0), //
+ B(Star), R(0), //
+ B(Ldar), R(0), //
+ B(Return), //
+ }},
+ };
+
+ for (size_t i = 0; i < arraysize(snippets); i++) {
+ Handle<BytecodeArray> bytecode_array =
+ helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
+ CheckBytecodeArrayEqual(snippets[i], bytecode_array);
+ }
+}
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698