Commit d9c4553a authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[test] Fix source positions in bytecode expectations

Fix a cctest/test-bytecode-generator/PrivateMethods mismatch between the
PrivateMethods source string and the snippet in the golden file due to
missing newline at the end of the string. Change C++ raw string back to
a normal string since in this case it makes it harder to see the
problem.

Change-Id: I3bea8873d37fbacac65548be8261f6b04104132f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1709413
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62823}
parent a348e902
...@@ -52,7 +52,7 @@ bytecodes: [ ...@@ -52,7 +52,7 @@ bytecodes: [
B(Star), R(3), B(Star), R(3),
/* 133 E> */ B(CallProperty0), R(3), R(1), U8(4), /* 133 E> */ B(CallProperty0), R(3), R(1), U8(4),
B(LdaUndefined), B(LdaUndefined),
/* 143 S> */ B(Return), /* 144 S> */ B(Return),
] ]
constant pool: [ constant pool: [
SCOPE_INFO_TYPE, SCOPE_INFO_TYPE,
...@@ -138,7 +138,7 @@ bytecodes: [ ...@@ -138,7 +138,7 @@ bytecodes: [
B(Star), R(5), B(Star), R(5),
/* 232 E> */ B(CallProperty0), R(5), R(2), U8(4), /* 232 E> */ B(CallProperty0), R(5), R(2), U8(4),
B(LdaUndefined), B(LdaUndefined),
/* 242 S> */ B(Return), /* 243 S> */ B(Return),
] ]
constant pool: [ constant pool: [
SCOPE_INFO_TYPE, SCOPE_INFO_TYPE,
......
...@@ -2765,29 +2765,31 @@ TEST(PrivateMethods) { ...@@ -2765,29 +2765,31 @@ TEST(PrivateMethods) {
BytecodeExpectationsPrinter printer(CcTest::isolate()); BytecodeExpectationsPrinter printer(CcTest::isolate());
const char* snippets[] = { const char* snippets[] = {
R"({ "{\n"
class A { " class A {\n"
#a() { return 1; } " #a() { return 1; }\n"
callA() { return this.#a(); } " callA() { return this.#a(); }\n"
} " }\n"
"\n"
const a = new A; " const a = new A;\n"
a.callA(); " a.callA();\n"
})", "}\n",
R"({
class D {
#d() { return 1; }
callD() { return this.#d(); }
}
class E extends D { "{\n"
#e() { return 2; } " class D {\n"
callE() { return this.callD() + this.#e(); } " #d() { return 1; }\n"
} " callD() { return this.#d(); }\n"
" }\n"
"\n"
" class E extends D {\n"
" #e() { return 2; }\n"
" callE() { return this.callD() + this.#e(); }\n"
" }\n"
"\n"
" const e = new E;\n"
" e.callE();\n"
"}\n"};
const e = new E;
e.callE();
})"};
CHECK(CompareTexts(BuildActual(printer, snippets), CHECK(CompareTexts(BuildActual(printer, snippets),
LoadGolden("PrivateMethods.golden"))); LoadGolden("PrivateMethods.golden")));
i::FLAG_harmony_private_methods = old_methods_flag; i::FLAG_harmony_private_methods = old_methods_flag;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment