@@ -84,6 +84,8 @@ pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {
84
84
( "avg" , builtin_avg:: INST ) ,
85
85
( "removeAt" , builtin_remove_at:: INST ) ,
86
86
( "remove" , builtin_remove:: INST ) ,
87
+ ( "flattenArrays" , builtin_flatten_arrays:: INST ) ,
88
+ ( "filterMap" , builtin_filter_map:: INST ) ,
87
89
// Math
88
90
( "abs" , builtin_abs:: INST ) ,
89
91
( "sign" , builtin_sign:: INST ) ,
@@ -137,17 +139,22 @@ pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {
137
139
( "base64DecodeBytes" , builtin_base64_decode_bytes:: INST ) ,
138
140
// Objects
139
141
( "objectFieldsEx" , builtin_object_fields_ex:: INST ) ,
142
+ ( "objectFields" , builtin_object_fields:: INST ) ,
143
+ ( "objectFieldsAll" , builtin_object_fields_all:: INST ) ,
140
144
( "objectValues" , builtin_object_values:: INST ) ,
141
145
( "objectValuesAll" , builtin_object_values_all:: INST ) ,
142
146
( "objectKeysValues" , builtin_object_keys_values:: INST ) ,
143
147
( "objectKeysValuesAll" , builtin_object_keys_values_all:: INST ) ,
144
148
( "objectHasEx" , builtin_object_has_ex:: INST ) ,
149
+ ( "objectHas" , builtin_object_has:: INST ) ,
150
+ ( "objectHasAll" , builtin_object_has_all:: INST ) ,
145
151
( "objectRemoveKey" , builtin_object_remove_key:: INST ) ,
146
152
// Manifest
147
153
( "escapeStringJson" , builtin_escape_string_json:: INST ) ,
148
154
( "manifestJsonEx" , builtin_manifest_json_ex:: INST ) ,
149
155
( "manifestYamlDoc" , builtin_manifest_yaml_doc:: INST ) ,
150
156
( "manifestTomlEx" , builtin_manifest_toml_ex:: INST ) ,
157
+ ( "toString" , builtin_to_string:: INST ) ,
151
158
// Parsing
152
159
( "parseJson" , builtin_parse_json:: INST ) ,
153
160
( "parseYaml" , builtin_parse_yaml:: INST ) ,
@@ -167,6 +174,7 @@ pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {
167
174
( "bigint" , builtin_bigint:: INST ) ,
168
175
( "parseOctal" , builtin_parse_octal:: INST ) ,
169
176
( "parseHex" , builtin_parse_hex:: INST ) ,
177
+ ( "stringChars" , builtin_string_chars:: INST ) ,
170
178
// Misc
171
179
( "length" , builtin_length:: INST ) ,
172
180
( "startsWith" , builtin_starts_with:: INST ) ,
@@ -175,6 +183,7 @@ pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {
175
183
( "setMember" , builtin_set_member:: INST ) ,
176
184
( "setInter" , builtin_set_inter:: INST ) ,
177
185
( "setDiff" , builtin_set_diff:: INST ) ,
186
+ ( "setUnion" , builtin_set_union:: INST ) ,
178
187
// Compat
179
188
( "__compare" , builtin___compare:: INST ) ,
180
189
]
@@ -347,19 +356,15 @@ impl jrsonnet_evaluator::ContextInitializer for ContextInitializer {
347
356
348
357
let mut std = ObjValueBuilder :: new ( ) ;
349
358
std. with_super ( self . stdlib_obj . clone ( ) ) ;
350
- std. field ( "thisFile" . into ( ) )
359
+ std. field ( "thisFile" )
351
360
. hide ( )
352
- . value ( Val :: string ( match source. source_path ( ) . path ( ) {
353
- Some ( p) => self . settings ( ) . path_resolver . resolve ( p) . into ( ) ,
354
- None => source. source_path ( ) . to_string ( ) . into ( ) ,
355
- } ) )
356
- . expect ( "this object builder is empty" ) ;
361
+ . value ( match source. source_path ( ) . path ( ) {
362
+ Some ( p) => self . settings ( ) . path_resolver . resolve ( p) ,
363
+ None => source. source_path ( ) . to_string ( ) ,
364
+ } ) ;
357
365
let stdlib_with_this_file = std. build ( ) ;
358
366
359
- builder. bind (
360
- "std" . into ( ) ,
361
- Thunk :: evaluated ( Val :: Obj ( stdlib_with_this_file) ) ,
362
- ) ;
367
+ builder. bind ( "std" , Thunk :: evaluated ( Val :: Obj ( stdlib_with_this_file) ) ) ;
363
368
}
364
369
fn as_any ( & self ) -> & dyn std:: any:: Any {
365
370
self
0 commit comments