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