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 |