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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/base/atomic-utils.h" | 9 #include "src/base/atomic-utils.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 isolate_->native_context()->object_function(), isolate_); | 1875 isolate_->native_context()->object_function(), isolate_); |
1876 exports_object = | 1876 exports_object = |
1877 isolate_->factory()->NewJSObject(object_function, TENURED); | 1877 isolate_->factory()->NewJSObject(object_function, TENURED); |
1878 Handle<String> exports_name = | 1878 Handle<String> exports_name = |
1879 isolate_->factory()->InternalizeUtf8String("exports"); | 1879 isolate_->factory()->InternalizeUtf8String("exports"); |
1880 JSObject::AddProperty(instance, exports_name, exports_object, NONE); | 1880 JSObject::AddProperty(instance, exports_name, exports_object, NONE); |
1881 } | 1881 } |
1882 | 1882 |
1883 PropertyDescriptor desc; | 1883 PropertyDescriptor desc; |
1884 desc.set_writable(false); | 1884 desc.set_writable(false); |
| 1885 desc.set_enumerable(true); |
1885 | 1886 |
1886 // Count up export indexes. | 1887 // Count up export indexes. |
1887 int export_index = 0; | 1888 int export_index = 0; |
1888 for (auto exp : module_->export_table) { | 1889 for (auto exp : module_->export_table) { |
1889 if (exp.kind == kExternalFunction) { | 1890 if (exp.kind == kExternalFunction) { |
1890 ++export_index; | 1891 ++export_index; |
1891 } | 1892 } |
1892 } | 1893 } |
1893 | 1894 |
1894 // Store weak references to all exported functions. | 1895 // Store weak references to all exported functions. |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 | 2640 |
2640 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), | 2641 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), |
2641 NONE); | 2642 NONE); |
2642 JSObject::AddProperty(entry, kind_string, export_kind, NONE); | 2643 JSObject::AddProperty(entry, kind_string, export_kind, NONE); |
2643 | 2644 |
2644 storage->set(index, *entry); | 2645 storage->set(index, *entry); |
2645 } | 2646 } |
2646 | 2647 |
2647 return array_object; | 2648 return array_object; |
2648 } | 2649 } |
OLD | NEW |