Skip to content

Commit

Permalink
[be][tests] Remove all hir-tests (cleanup for ObjectShape stack)
Browse files Browse the repository at this point in the history
--- 

+10 −1,698 lines [[insert impacc macro]] 

The ObjectShape stacks (#1350, #1358) used these tests to record changes in 
inferred types (and associated ObjectShapes), reference effects, and mutable 
ranges. 

Now that those PRs have landed, we can delete these tests. They are somewhat 
fragile (changing anytime HIR / printHIR is changed) and easily cause 
rebase/merge conflicts.
  • Loading branch information
mofeiZ committed Mar 23, 2023
1 parent c3589a9 commit 447f401
Show file tree
Hide file tree
Showing 38 changed files with 318 additions and 823 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

## Input

```javascript
function foo(props) {
let x = [];
x.push(props.bar);
const _ = props.cond
? (({ x } = { x: {} }), ([x] = [[]]), x.push(props.foo))
: null;
console.log(_);
mut(x);
return x;
}

```

## Code

```javascript
function foo(props) {
const $ = React.unstable_useMemoCache(2);
const c_0 = $[0] !== props;
let x;
if (c_0) {
x = [];
x.push(props.bar);
const _ = props.cond ? (([x] = [[]]), x.push(props.foo)) : null;

console.log(_);
mut(x);
$[0] = props;
$[1] = x;
} else {
x = $[1];
}
return x;
}

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

## Input

```javascript
function foo(props) {
let x = [];
x.push(props.bar);
const _ = props.cond
? (({ x } = { x: {} }), ([x] = [[]]), x.push(props.foo))
: null;
console.log(_);
return x;
}

```

## Code

```javascript
function foo(props) {
const $ = React.unstable_useMemoCache(4);
const c_0 = $[0] !== props.bar;
let x;
if (c_0) {
x = [];
x.push(props.bar);
$[0] = props.bar;
$[1] = x;
} else {
x = $[1];
}
const c_2 = $[2] !== props;
if (c_2) {
const _ = props.cond ? (([x] = [[]]), x.push(props.foo)) : null;

console.log(_);
$[2] = props;
$[3] = x;
} else {
x = $[3];
}
return x;
}

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

## Input

```javascript
function foo(props) {
let x = [];
x.push(props.bar);
const _ = props.cond ? ((x = {}), (x = []), x.push(props.foo)) : null;
console.log(_);
mut(x);
return x;
}

```

## Code

```javascript
function foo(props) {
const $ = React.unstable_useMemoCache(2);
const c_0 = $[0] !== props;
let x;
if (c_0) {
x = [];
x.push(props.bar);
const _ = props.cond ? ((x = []), x.push(props.foo)) : null;
console.log(_);
mut(x);
$[0] = props;
$[1] = x;
} else {
x = $[1];
}
return x;
}

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

## Input

```javascript
function foo(props) {
let x = [];
x.push(props.bar);
const _ = props.cond ? ((x = {}), (x = []), x.push(props.foo)) : null;
console.log(_);
return x;
}

```

## Code

```javascript
function foo(props) {
const $ = React.unstable_useMemoCache(4);
const c_0 = $[0] !== props.bar;
let x;
if (c_0) {
x = [];
x.push(props.bar);
$[0] = props.bar;
$[1] = x;
} else {
x = $[1];
}
const c_2 = $[2] !== props;
if (c_2) {
const _ = props.cond ? ((x = []), x.push(props.foo)) : null;
console.log(_);
$[2] = props;
$[3] = x;
} else {
x = $[3];
}
return x;
}

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

## Input

```javascript
function foo(props) {
let x = [];
x.push(props.bar);
const _ = props.cond
? ((x = {}), (x = []), x.push(props.foo))
: ((x = []), (x = []), x.push(props.bar));
console.log(_);
mut(x);
return x;
}

```

## Code

```javascript
function foo(props) {
const $ = React.unstable_useMemoCache(2);
const c_0 = $[0] !== props;
let x;
if (c_0) {
x = [];
x.push(props.bar);
const _ = props.cond
? ((x = []), x.push(props.foo))
: ((x = []), x.push(props.bar));
console.log(_);
mut(x);
$[0] = props;
$[1] = x;
} else {
x = $[1];
}
return x;
}

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

## Input

```javascript
function foo(props) {
let x = [];
x.push(props.bar);
const _ = props.cond
? ((x = {}), (x = []), x.push(props.foo))
: ((x = []), (x = []), x.push(props.bar));
console.log(_);
return x;
}

```

## Code

```javascript
function foo(props) {
const $ = React.unstable_useMemoCache(4);
const c_0 = $[0] !== props.bar;
let x;
if (c_0) {
x = [];
x.push(props.bar);
$[0] = props.bar;
$[1] = x;
} else {
x = $[1];
}
const c_2 = $[2] !== props;
if (c_2) {
const _ = props.cond
? ((x = []), x.push(props.foo))
: ((x = []), x.push(props.bar));
console.log(_);
$[2] = props;
$[3] = x;
} else {
x = $[3];
}
return x;
}

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

## Input

```javascript
function foo(props) {
let x = [];
x.push(props.bar);
if (props.cond) {
x = {};
x = [];
x.push(props.foo);
} else {
x = [];
x = [];
x.push(props.bar);
}
mut(x);
return x;
}

```

## Code

```javascript
function foo(props) {
const $ = React.unstable_useMemoCache(2);
const c_0 = $[0] !== props;
let x;
if (c_0) {
x = [];
x.push(props.bar);
if (props.cond) {
x = [];
x.push(props.foo);
} else {
x = [];
x.push(props.bar);
}

mut(x);
$[0] = props;
$[1] = x;
} else {
x = $[1];
}
return x;
}

```

This file was deleted.

This file was deleted.

Loading

0 comments on commit 447f401

Please sign in to comment.