Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lookupStr not to lookup when str is Bottom #154

Merged
merged 2 commits into from
Jul 17, 2023
Merged

Conversation

hyp3rflow
Copy link
Member

@hyp3rflow hyp3rflow commented Jul 6, 2023

This PR fix lookupStr not to lookup when base object's str is Bottom. This leads to fix 3 existing type mismatch and affect some cases accessing length property invalidly.

Resolve 3 Type mismatches

3 mismatches below are resolved after fix.

  • ES2022: 82 → 79
  • ES2023: 78 → 75 (resolved bugs are same as in ES2022)

Side-effect: Imprecise return type analysis

This PR affects conditions using "length" properties. There are 23 common changes in both ES2022/ES2023, along with 1 unique change in each version(ES2022/ES2023), amounting to a total of 25 changes. These changes can be classified with 3 IR-patterns like below:

  • A: k.[["length"]] (k is Undefined)
    Let's see quick example with INTRINSICS.Map.prototype.clear below.
    In the first step, accessing a property from ESValue type with concrete String key(corresponds to MapData in example) results Absent. This behavior is not influenced by the change in this PR. However, the subsequent step is indeed affected. Here, accessing "length" property from Undefined now results Bot, where as previously resulted in MathT.
    Consequently, the result of numericCompare (< %1 %2.length) becomes Bot, leading to an incomplete analysis.
def <BUILTIN>:INTRINSICS.Map.prototype.clear(
  this: ESValue,
  ArgumentsList: List[ESValue],
  NewTarget: Object | Undefined,
): Unknown {
  let M = this // M: ESValue
  call %0 = clo<RequireInternalSlot>(M, "MapData")
  [? %0]
  let entries = M.MapData // (ESValue).MapData → Absent (same as before)
  %2 = entries // %2: Undefined (due to `get(x: Id, cp: ControlPoint)` implementation) (same as before)
  %1 = 0
  loop[foreach] (< %1 %2.length) { // %2.length → Bot (before: MathT)
    let p = %2[%1]
    p.Key = ~empty~
    p.Value = ~empty~
    %1 = (+ %1 1)
  }
  return undefined
}
  • B: k.[["length"]] (k is Bot), before: k = (new [])
    When the base object type is Bot, similar to Case A where it's Undefined, accessing the "length" property also previously resulted in MathT. I think this scenario can be resolved by correctly handling (new []).
def <BUILTIN>:INTRINSICS.Math.max(
  this: ESValue,
  ArgumentsList: List[ESValue],
  NewTarget: Object | Undefined,
): Unknown {
  let args = ArgumentsList
  let coerced = (new []) // coerced: Bot
  %1 = args
  %0 = 0
  loop[foreach] (< %0 %1.length) {
    let arg = %1[%0]
    call %2 = clo<ToNumber>(arg)
    let n = [? %2]
    push coerced < n
    %0 = (+ %0 1)
  }
  let highest = -INF
  %4 = coerced // %4: Bot
  %3 = 0
  loop[foreach] (< %3 %4.length) { // %4.length → Bot (before: MathT)
    let number = %4[%3]
    if (= number NaN) {
      return NaN
    } else {}
    if (&& (= number 0.0f) (= highest -0.0f)) {
      highest = 0.0f
    } else {}
    if (< highest number) {
      highest = number
    } else {}
    %3 = (+ %3 1)
  }
  return highest
}
  • C: k.[["length"]] (k is Bot) but in Abstract Closure.
    In this case, I don't know how abstract closure analysis works now exactly, but precise analysis for captured variable types can resolve problems in this case.

Here are the total counts for each criterion:

A: 16
Name Annotated return type Before After
INTRINSICS.FinalizationRegistry.prototype.unregister Unknown Normal[False] | Abrupt Abrupt
INTRINSICS.Map.prototype.clear Unknown Normal[Undefined] | Abrupt Abrupt
INTRINSICS.Map.prototype.delete Unknown Normal[False] | Abrupt Abrupt
INTRINSICS.Map.prototype.forEach Unknown Normal[Undefined] | Abrupt Abrupt
INTRINSICS.Map.prototype.get Unknown Normal[Undefined] | Abrupt Abrupt
INTRINSICS.Map.prototype.has Unknown Normal[False] | Abrupt Abrupt
INTRINSICS.Map.prototype.set Unknown Normal[ESValue] | Abrupt Abrupt
INTRINSICS.Set.prototype.add Unknown Normal[ESValue] | Abrupt Abrupt
INTRINSICS.Set.prototype.clear Unknown Normal[Undefined] | Abrupt Abrupt
INTRINSICS.Set.prototype.delete Unknown Normal[False] | Abrupt Abrupt
INTRINSICS.Set.prototype.forEach Unknown Normal[Undefined] | Abrupt Abrupt
INTRINSICS.Set.prototype.has Unknown Normal[False] | Abrupt Abrupt
INTRINSICS.WeakMap.prototype.set Unknown Normal[ESValue] | Abrupt Abrupt
INTRINSICS.WeakSet.prototype.add Unknown Normal[ESValue] | Abrupt Abrupt
INTRINSICS.get Map.prototype.size Unknown Normal[Number] | Abrupt Abrupt
INTRINSICS.get Set.prototype.size Unknown Normal[Number] | Abrupt Abrupt
B: 5 `INTRINSICS.TypedArray.prototype.filter` diff is only in ES2023.
Name Annotated return type Before After
INTRINSICS.Math.hypot Unknown Normal[Number[0.0]] | Abrupt[throw] Abrupt[throw]
INTRINSICS.Math.max Unknown Normal[Number[-INF]] | Abrupt[throw] Abrupt[throw]
INTRINSICS.Math.min Unknown Normal[Number[+INF]] | Abrupt[throw] Abrupt[throw]
INTRINSICS.RegExp.prototype[@@replace] (only at ES2022) Unknown Normal[String] | Abrupt Abrupt
INTRINSICS.TypedArray.prototype.filter (only at ES2023) Unknown Normal[Object] | Abrupt[throw] Abrupt[throw]
CreateListIteratorRecord:clo0 Unknown Undefined Unknown
CreateMapIterator:clo0 Unknown Undefined Unknown
CreateSetIterator:clo0 Unknown Undefined Unknown
INTRINSICS.String.prototype[@@iterator]:clo0 Unknown Undefined Unknown
C: 4 `INTRINSICS.RegExp.prototype[@@replace]` diff is only in ES2022.
Name Annotated return type Before After
CreateListIteratorRecord:clo0 Unknown Undefined Unknown
CreateMapIterator:clo0 Unknown Undefined Unknown
CreateSetIterator:clo0 Unknown Undefined Unknown
INTRINSICS.String.prototype[@@iterator]:clo0 Unknown Undefined Unknown

Misc

total diff (`/logs/analyze/types` with ES2022) Total 24, INTRINSICS.RegExp.prototype[@@replace] is only in ES2022
    def <CLO>:CreateListIteratorRecord:clo0(): Unknown
--> def <CLO>:CreateListIteratorRecord:clo0(): Undefined (before)
+-> def <CLO>:CreateListIteratorRecord:clo0(): Unknown (after fix)
 --------------------------------------------------------------------------------
    def <CLO>:CreateMapIterator:clo0(): Unknown
--> def <CLO>:CreateMapIterator:clo0(): Undefined
+-> def <CLO>:CreateMapIterator:clo0(): Unknown
 --------------------------------------------------------------------------------
    def <CLO>:CreateSetIterator:clo0(): Unknown
--> def <CLO>:CreateSetIterator:clo0(): Undefined
+-> def <CLO>:CreateSetIterator:clo0(): Unknown
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.FinalizationRegistry.prototype.unregister(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.FinalizationRegistry.prototype.unregister(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt
+-> def <BUILTIN>:INTRINSICS.FinalizationRegistry.prototype.unregister(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Map.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Map.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Map.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Map.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Map.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Map.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Map.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Map.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Map.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Map.prototype.get(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Map.prototype.get(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Map.prototype.get(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Map.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Map.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Map.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Map.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Map.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[ESValue] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Map.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Math.hypot(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Math.hypot(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number[0.0]] | Abrupt[throw]
+-> def <BUILTIN>:INTRINSICS.Math.hypot(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw]
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Math.max(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Math.max(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number[-INF]] | Abrupt[throw]
+-> def <BUILTIN>:INTRINSICS.Math.max(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw]
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Math.min(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Math.min(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number[+INF]] | Abrupt[throw]
+-> def <BUILTIN>:INTRINSICS.Math.min(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw]
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.RegExp.prototype[@@replace](this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.RegExp.prototype[@@replace](this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[String] | Abrupt
+-> def <BUILTIN>:INTRINSICS.RegExp.prototype[@@replace](this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Set.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Set.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[ESValue] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Set.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Set.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Set.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Set.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Set.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Set.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Set.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Set.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Set.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Set.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.Set.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.Set.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt
+-> def <BUILTIN>:INTRINSICS.Set.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <CLO>:INTRINSICS.String.prototype[@@iterator]:clo0(): Unknown
--> def <CLO>:INTRINSICS.String.prototype[@@iterator]:clo0(): Undefined
+-> def <CLO>:INTRINSICS.String.prototype[@@iterator]:clo0(): Unknown
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.WeakMap.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.WeakMap.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[ESValue] | Abrupt
+-> def <BUILTIN>:INTRINSICS.WeakMap.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.WeakSet.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.WeakSet.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[ESValue] | Abrupt
+-> def <BUILTIN>:INTRINSICS.WeakSet.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.get Map.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.get Map.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number] | Abrupt
+-> def <BUILTIN>:INTRINSICS.get Map.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
    def <BUILTIN>:INTRINSICS.get Set.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown
--> def <BUILTIN>:INTRINSICS.get Set.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number] | Abrupt
+-> def <BUILTIN>:INTRINSICS.get Set.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt
 --------------------------------------------------------------------------------
total diff (`/logs/analyze/types` with ES2023) Total 24, INTRINSICS.TypedArray.prototype.filter is only in ES2023 ``` def :CreateListIteratorRecord:clo0(): Unknown --> def :CreateListIteratorRecord:clo0(): Normal[Undefined] | Abrupt (before) +-> def :CreateListIteratorRecord:clo0(): Unknown (after fix) -------------------------------------------------------------------------------- def :CreateMapIterator:clo0(): Unknown --> def :CreateMapIterator:clo0(): Undefined +-> def :CreateMapIterator:clo0(): Unknown -------------------------------------------------------------------------------- def :CreateSetIterator:clo0(): Unknown --> def :CreateSetIterator:clo0(): Undefined +-> def :CreateSetIterator:clo0(): Unknown -------------------------------------------------------------------------------- def :INTRINSICS.FinalizationRegistry.prototype.unregister(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.FinalizationRegistry.prototype.unregister(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt[throw] +-> def :INTRINSICS.FinalizationRegistry.prototype.unregister(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Map.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Map.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt[throw] +-> def :INTRINSICS.Map.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Map.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Map.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt[throw] +-> def :INTRINSICS.Map.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Map.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Map.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt[throw] +-> def :INTRINSICS.Map.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Map.prototype.get(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Map.prototype.get(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt[throw] +-> def :INTRINSICS.Map.prototype.get(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Map.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Map.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt[throw] +-> def :INTRINSICS.Map.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Map.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Map.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[ESValue] | Abrupt[throw] +-> def :INTRINSICS.Map.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Math.hypot(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Math.hypot(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number[0.0]] | Abrupt[throw] +-> def :INTRINSICS.Math.hypot(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Math.max(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Math.max(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number[-INF]] | Abrupt[throw] +-> def :INTRINSICS.Math.max(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Math.min(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Math.min(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number[+INF]] | Abrupt[throw] +-> def :INTRINSICS.Math.min(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Set.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Set.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[ESValue] | Abrupt[throw] +-> def :INTRINSICS.Set.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Set.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Set.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt[throw] +-> def :INTRINSICS.Set.prototype.clear(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Set.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Set.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt[throw] +-> def :INTRINSICS.Set.prototype.delete(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Set.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Set.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Undefined] | Abrupt[throw] +-> def :INTRINSICS.Set.prototype.forEach(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.Set.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.Set.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[False] | Abrupt[throw] +-> def :INTRINSICS.Set.prototype.has(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.String.prototype[@@iterator]:clo0(): Unknown --> def :INTRINSICS.String.prototype[@@iterator]:clo0(): Undefined +-> def :INTRINSICS.String.prototype[@@iterator]:clo0(): Unknown -------------------------------------------------------------------------------- def :INTRINSICS.TypedArray.prototype.filter(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.TypedArray.prototype.filter(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Object] | Abrupt[throw] +-> def :INTRINSICS.TypedArray.prototype.filter(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.WeakMap.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.WeakMap.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[ESValue] | Abrupt[throw] +-> def :INTRINSICS.WeakMap.prototype.set(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.WeakSet.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.WeakSet.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[ESValue] | Abrupt[throw] +-> def :INTRINSICS.WeakSet.prototype.add(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.get Map.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.get Map.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number] | Abrupt[throw] +-> def :INTRINSICS.get Map.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- def :INTRINSICS.get Set.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Unknown --> def :INTRINSICS.get Set.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Normal[Number] | Abrupt[throw] +-> def :INTRINSICS.get Set.prototype.size(this: ESValue, ArgumentsList: List[ESValue], NewTarget: Object | Undefined): Abrupt[throw] -------------------------------------------------------------------------------- ```

@hyp3rflow hyp3rflow marked this pull request as draft July 6, 2023 07:51
@hyp3rflow hyp3rflow marked this pull request as ready for review July 7, 2023 06:21
@hyp3rflow hyp3rflow requested a review from jhnaldo July 7, 2023 06:21
@hyp3rflow hyp3rflow self-assigned this Jul 7, 2023
@jhnaldo jhnaldo added bug Something isn't working area:analyzer Related to analyzer area:type Related to types labels Jul 17, 2023
Copy link
Contributor

@jhnaldo jhnaldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍🏻 I slightly refactored your code. After your confirmation, I will merge it.

@hyp3rflow
Copy link
Member Author

@jhnaldo LGTM 😊 thanks!

@jhnaldo jhnaldo merged commit 5964bd4 into dev Jul 17, 2023
6 checks passed
@jhnaldo jhnaldo deleted the fix/type-lookupstr branch July 17, 2023 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:analyzer Related to analyzer area:type Related to types bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants