Index: test/cctest/test-serialize.cc |
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc |
index 8477c384f3c245e3a8f844b4a9f8550d97149c60..c90ddb9c5d16ea0324cb1a6f44f160ab3da0a711 100644 |
--- a/test/cctest/test-serialize.cc |
+++ b/test/cctest/test-serialize.cc |
@@ -462,7 +462,8 @@ static void PartiallySerializeCustomContext( |
" e = function(s) { return eval (s); }" |
"})();" |
"var o = this;" |
- "var r = Math.sin(0) + Math.cos(0);" |
+ "var r = Math.random();" |
+ "var c = Math.sin(0) + Math.cos(0);" |
"var f = (function(a, b) { return a + b; }).bind(1, 2, 3);" |
"var s = parseInt('12345');"); |
@@ -558,7 +559,18 @@ UNINITIALIZED_TEST(PartialSerializerCustomContext) { |
->ToNumber(v8_isolate->GetCurrentContext()) |
.ToLocalChecked() |
->Value(); |
- CHECK_EQ(1, r); |
+ CHECK(0.0 <= r && r < 1.0); |
+ // Math.random still works. |
+ double random = CompileRun("Math.random()") |
+ ->ToNumber(v8_isolate->GetCurrentContext()) |
+ .ToLocalChecked() |
+ ->Value(); |
+ CHECK(0.0 <= random && random < 1.0); |
+ double c = CompileRun("c") |
+ ->ToNumber(v8_isolate->GetCurrentContext()) |
+ .ToLocalChecked() |
+ ->Value(); |
+ CHECK_EQ(1, c); |
int f = CompileRun("f()") |
->ToNumber(v8_isolate->GetCurrentContext()) |
.ToLocalChecked() |