2325ad7e62
I don't see a reason why we can't benefit from preparsing such functions. We don't necessarily compile them, so fully parsing them when unnecessary is just additional overhead. BUG=v8:5501 Review-Url: https://codereview.chromium.org/2413213002 Cr-Commit-Position: refs/heads/master@{#40248}
14 lines
380 B
JavaScript
14 lines
380 B
JavaScript
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Flags: --min-preparse-length=0
|
|
|
|
"use strict";
|
|
var x = 1;
|
|
var g = eval("var y = 100; function h(s) { if (s) x = s; return x+y; }; h");
|
|
|
|
assertEquals(101, g());
|
|
assertEquals(102, g(2));
|
|
assertEquals(102, g(2));
|