@@ -26,6 +26,16 @@ pub struct Intrinsics {
2626 pub ( super ) templates : ObjectTemplates ,
2727}
2828
29+ impl crate :: snapshot:: Serialize for Intrinsics {
30+ fn serialize (
31+ & self ,
32+ s : & mut crate :: snapshot:: SnapshotSerializer ,
33+ ) -> Result < ( ) , crate :: snapshot:: SnapshotError > {
34+ self . constructors . serialize ( s) ?;
35+ Ok ( ( ) )
36+ }
37+ }
38+
2939impl Intrinsics {
3040 pub ( crate ) fn new ( root_shape : & RootShape ) -> Self {
3141 let constructors = StandardConstructors :: default ( ) ;
@@ -62,6 +72,17 @@ pub struct StandardConstructor {
6272 prototype : JsObject ,
6373}
6474
75+ impl crate :: snapshot:: Serialize for StandardConstructor {
76+ fn serialize (
77+ & self ,
78+ s : & mut crate :: snapshot:: SnapshotSerializer ,
79+ ) -> Result < ( ) , crate :: snapshot:: SnapshotError > {
80+ self . constructor . serialize ( s) ?;
81+ self . prototype . serialize ( s) ?;
82+ Ok ( ( ) )
83+ }
84+ }
85+
6586impl Default for StandardConstructor {
6687 fn default ( ) -> Self {
6788 Self {
@@ -153,6 +174,67 @@ pub struct StandardConstructors {
153174 segmenter : StandardConstructor ,
154175}
155176
177+ impl crate :: snapshot:: Serialize for StandardConstructors {
178+ fn serialize (
179+ & self ,
180+ s : & mut crate :: snapshot:: SnapshotSerializer ,
181+ ) -> Result < ( ) , crate :: snapshot:: SnapshotError > {
182+ self . object . serialize ( s) ?;
183+ self . proxy . serialize ( s) ?;
184+ self . date . serialize ( s) ?;
185+ self . function . serialize ( s) ?;
186+ self . async_function . serialize ( s) ?;
187+ self . generator_function . serialize ( s) ?;
188+ self . async_generator_function . serialize ( s) ?;
189+ self . array . serialize ( s) ?;
190+ self . bigint . serialize ( s) ?;
191+ self . number . serialize ( s) ?;
192+ self . boolean . serialize ( s) ?;
193+ self . string . serialize ( s) ?;
194+ self . regexp . serialize ( s) ?;
195+ self . symbol . serialize ( s) ?;
196+ self . error . serialize ( s) ?;
197+ self . type_error . serialize ( s) ?;
198+ self . reference_error . serialize ( s) ?;
199+ self . range_error . serialize ( s) ?;
200+ self . syntax_error . serialize ( s) ?;
201+ self . eval_error . serialize ( s) ?;
202+ self . uri_error . serialize ( s) ?;
203+ self . aggregate_error . serialize ( s) ?;
204+ self . map . serialize ( s) ?;
205+ self . set . serialize ( s) ?;
206+ self . typed_array . serialize ( s) ?;
207+ self . typed_int8_array . serialize ( s) ?;
208+ self . typed_uint8_array . serialize ( s) ?;
209+ self . typed_uint8clamped_array . serialize ( s) ?;
210+ self . typed_int16_array . serialize ( s) ?;
211+ self . typed_uint16_array . serialize ( s) ?;
212+ self . typed_int32_array . serialize ( s) ?;
213+ self . typed_uint32_array . serialize ( s) ?;
214+ self . typed_bigint64_array . serialize ( s) ?;
215+ self . typed_biguint64_array . serialize ( s) ?;
216+ self . typed_float32_array . serialize ( s) ?;
217+ self . typed_float64_array . serialize ( s) ?;
218+ self . array_buffer . serialize ( s) ?;
219+ self . data_view . serialize ( s) ?;
220+ self . date_time_format . serialize ( s) ?;
221+ self . promise . serialize ( s) ?;
222+ self . weak_ref . serialize ( s) ?;
223+ self . weak_map . serialize ( s) ?;
224+ self . weak_set . serialize ( s) ?;
225+ #[ cfg( feature = "intl" ) ]
226+ self . collator . serialize ( s) ?;
227+ #[ cfg( feature = "intl" ) ]
228+ self . list_format . serialize ( s) ?;
229+ #[ cfg( feature = "intl" ) ]
230+ self . locale . serialize ( s) ?;
231+ #[ cfg( feature = "intl" ) ]
232+ self . segmenter . serialize ( s) ?;
233+
234+ Ok ( ( ) )
235+ }
236+ }
237+
156238impl Default for StandardConstructors {
157239 fn default ( ) -> Self {
158240 Self {
0 commit comments