Commit 1e638c36 authored by verwaest's avatar verwaest Committed by Commit bot

Don't overwrite existing serial numbers on the function template, otherwise...

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}
parent 206303f7
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment