Don't overwrite existing serial numbers on the function template, otherwise instantiating the function for a new context causes the serial number to bump.
Review URL: https://codereview.chromium.org/988693003 Cr-Commit-Position: refs/heads/master@{#27048}
This commit is contained in:
parent
206303f703
commit
1e638c3610
@ -943,7 +943,7 @@ static Local<FunctionTemplate> FunctionTemplateNew(
|
||||
InitializeFunctionTemplate(obj);
|
||||
obj->set_do_not_cache(do_not_cache);
|
||||
int next_serial_number = 0;
|
||||
if (!do_not_cache) {
|
||||
if (!do_not_cache && !obj->serial_number()->IsSmi()) {
|
||||
next_serial_number = isolate->next_serial_number() + 1;
|
||||
isolate->set_next_serial_number(next_serial_number);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user