| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1e7a7be commit c544213
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1283,7 +1283,6 @@ namespace { | |||
| 1283 | 1283 | String* TypeOfString(HConstant* constant, Isolate* isolate) { | |
| 1284 | 1284 | Heap* heap = isolate->heap(); | |
| 1285 | 1285 | if (constant->HasNumberValue()) return heap->number_string(); | |
| 1286 | - if (constant->IsUndetectable()) return heap->undefined_string(); | ||
| 1287 | 1286 | if (constant->HasStringValue()) return heap->string_string(); | |
| 1288 | 1287 | switch (constant->GetInstanceType()) { | |
| 1289 | 1288 | case ODDBALL_TYPE: { | |
@@ -1312,6 +1311,7 @@ String* TypeOfString(HConstant* constant, Isolate* isolate) { | |||
| 1312 | 1311 | return nullptr; | |
| 1313 | 1312 | } | |
| 1314 | 1313 | default: | |
| 1314 | + if (constant->IsUndetectable()) return heap->undefined_string(); | ||
| 1315 | 1315 | if (constant->IsCallable()) return heap->function_string(); | |
| 1316 | 1316 | return heap->object_string(); | |
| 1317 | 1317 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,12 @@ | |||
| 1 | + // Copyright 2016 the V8 project authors. All rights reserved. | ||
| 2 | + // Use of this source code is governed by a BSD-style license that can be | ||
| 3 | + // found in the LICENSE file. | ||
| 4 | + | ||
| 5 | + // Flags: --allow-natives-syntax | ||
| 6 | + | ||
| 7 | + function f() { | ||
| 8 | + return typeof null === "object"; | ||
| 9 | + }; | ||
| 10 | + | ||
| 11 | + %OptimizeFunctionOnNextCall(f); | ||
| 12 | + assertTrue(f()); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments