OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 <limits.h> | 5 #include <limits.h> |
6 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "include/v8.h" | 9 #include "include/v8.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 v8::internal::Factory* factory = i_isolate->factory(); | 26 v8::internal::Factory* factory = i_isolate->factory(); |
27 | 27 |
28 if (size > INT_MAX) return 0; | 28 if (size > INT_MAX) return 0; |
29 v8::internal::MaybeHandle<v8::internal::String> source = | 29 v8::internal::MaybeHandle<v8::internal::String> source = |
30 factory->NewStringFromOneByte( | 30 factory->NewStringFromOneByte( |
31 v8::internal::Vector<const uint8_t>(data, static_cast<int>(size))); | 31 v8::internal::Vector<const uint8_t>(data, static_cast<int>(size))); |
32 if (source.is_null()) return 0; | 32 if (source.is_null()) return 0; |
33 | 33 |
34 v8::internal::Handle<v8::internal::Script> script = | 34 v8::internal::Handle<v8::internal::Script> script = |
35 factory->NewScript(source.ToHandleChecked()); | 35 factory->NewScript(source.ToHandleChecked()); |
36 v8::internal::Zone zone; | 36 v8::internal::Zone zone(i_isolate->allocator()); |
37 v8::internal::ParseInfo info(&zone, script); | 37 v8::internal::ParseInfo info(&zone, script); |
38 info.set_global(); | 38 info.set_global(); |
39 v8::internal::Parser parser(&info); | 39 v8::internal::Parser parser(&info); |
40 parser.Parse(&info); | 40 parser.Parse(&info); |
41 return 0; | 41 return 0; |
42 } | 42 } |
OLD | NEW |