OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "test/cctest/test-api.h" | 7 #include "test/cctest/test-api.h" |
8 | 8 |
9 #include "include/v8-util.h" | 9 #include "include/v8-util.h" |
10 #include "src/api.h" | 10 #include "src/api.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 using ::v8::MessageCallback; | 31 using ::v8::MessageCallback; |
32 using ::v8::Object; | 32 using ::v8::Object; |
33 using ::v8::ObjectTemplate; | 33 using ::v8::ObjectTemplate; |
34 using ::v8::Persistent; | 34 using ::v8::Persistent; |
35 using ::v8::Script; | 35 using ::v8::Script; |
36 using ::v8::StackTrace; | 36 using ::v8::StackTrace; |
37 using ::v8::String; | 37 using ::v8::String; |
38 using ::v8::Symbol; | 38 using ::v8::Symbol; |
39 using ::v8::TryCatch; | 39 using ::v8::TryCatch; |
40 using ::v8::Undefined; | 40 using ::v8::Undefined; |
41 using ::v8::UniqueId; | |
42 using ::v8::V8; | 41 using ::v8::V8; |
43 using ::v8::Value; | 42 using ::v8::Value; |
44 | 43 |
45 | 44 |
46 namespace { | 45 namespace { |
47 | 46 |
48 void Returns42(const v8::FunctionCallbackInfo<v8::Value>& info) { | 47 void Returns42(const v8::FunctionCallbackInfo<v8::Value>& info) { |
49 info.GetReturnValue().Set(42); | 48 info.GetReturnValue().Set(42); |
50 } | 49 } |
51 | 50 |
(...skipping 4963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5015 ->Set(env.local(), v8_str("Fun"), | 5014 ->Set(env.local(), v8_str("Fun"), |
5016 fun_templ->GetFunction(env.local()).ToLocalChecked()) | 5015 fun_templ->GetFunction(env.local()).ToLocalChecked()) |
5017 .FromJust()); | 5016 .FromJust()); |
5018 | 5017 |
5019 CompileRun( | 5018 CompileRun( |
5020 "var f = new Fun();" | 5019 "var f = new Fun();" |
5021 "Number.prototype.__proto__ = f;" | 5020 "Number.prototype.__proto__ = f;" |
5022 "var a = 42;" | 5021 "var a = 42;" |
5023 "for (var i = 0; i<3; i++) { a.foo; }"); | 5022 "for (var i = 0; i<3; i++) { a.foo; }"); |
5024 } | 5023 } |
OLD | NEW |