@@ -2234,18 +2234,22 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
2234
2234
// this function, replace the uncompiled data with one that includes it.
2235
2235
if (literal->produced_preparse_data () != nullptr &&
2236
2236
existing->HasUncompiledDataWithoutPreparseData ()) {
2237
- DCHECK (literal-> inferred_name ()-> Equals (
2238
- existing->uncompiled_data (). inferred_name ()) );
2237
+ Handle <UncompiledData> existing_uncompiled_data =
2238
+ handle ( existing->uncompiled_data (), isolate );
2239
2239
DCHECK_EQ (literal->start_position (),
2240
- existing-> uncompiled_data (). start_position ());
2240
+ existing_uncompiled_data-> start_position ());
2241
2241
DCHECK_EQ (literal->end_position (),
2242
- existing->uncompiled_data ().end_position ());
2242
+ existing_uncompiled_data->end_position ());
2243
+ // Use existing uncompiled data's inferred name as it may be more
2244
+ // accurate than the literal we preparsed.
2245
+ Handle <String> inferred_name =
2246
+ handle (existing_uncompiled_data->inferred_name (), isolate);
2243
2247
Handle <PreparseData> preparse_data =
2244
2248
literal->produced_preparse_data ()->Serialize (isolate);
2245
2249
Handle <UncompiledData> new_uncompiled_data =
2246
2250
isolate->factory ()->NewUncompiledDataWithPreparseData (
2247
- literal-> inferred_name (), literal ->start_position (),
2248
- literal ->end_position (), preparse_data);
2251
+ inferred_name, existing_uncompiled_data ->start_position (),
2252
+ existing_uncompiled_data ->end_position (), preparse_data);
2249
2253
existing->set_uncompiled_data (*new_uncompiled_data);
2250
2254
}
2251
2255
return existing;
0 commit comments