Skip to content

Commit 97ebee1

Browse files
[WSL] Small cleanup in Evaluator
https://bugs.webkit.org/show_bug.cgi?id=176971 Reviewed by Filip Pizlo. Use the symbols for break and continue instead of the objects themselves. No tests because there is no behavior change. * WebGPUShadingLanguageRI/Evaluator.js: (Evaluator.prototype.visitWhileLoop): (Evaluator.prototype.visitDoWhileLoop): (Evaluator.prototype.visitForLoop): (Evaluator.prototype.visitBreak): (Evaluator.prototype.visitContinue): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 394a5a7 commit 97ebee1

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

Tools/ChangeLog

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2017-09-15 Myles C. Maxfield <[email protected]>
2+
3+
[WSL] Small cleanup in Evaluator
4+
https://bugs.webkit.org/show_bug.cgi?id=176971
5+
6+
Reviewed by Filip Pizlo.
7+
8+
Use the symbols for break and continue instead of the objects themselves.
9+
10+
No tests because there is no behavior change.
11+
12+
* WebGPUShadingLanguageRI/Evaluator.js:
13+
(Evaluator.prototype.visitWhileLoop):
14+
(Evaluator.prototype.visitDoWhileLoop):
15+
(Evaluator.prototype.visitForLoop):
16+
(Evaluator.prototype.visitBreak):
17+
(Evaluator.prototype.visitContinue):
18+
119
2017-09-15 Filip Pizlo <[email protected]>
220

321
WSL Evaluator should only allocate EBuffers when dealing with intrinsics

Tools/WebGPUShadingLanguageRI/Evaluator.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ class Evaluator extends Visitor {
180180
try {
181181
node.body.visit(this);
182182
} catch (e) {
183-
if (e instanceof Break)
183+
if (e == BreakException)
184184
break;
185-
if (e instanceof Continue)
185+
if (e == ContinueException)
186186
continue;
187187
throw e;
188188
}
@@ -195,9 +195,9 @@ class Evaluator extends Visitor {
195195
try {
196196
node.body.visit(this);
197197
} catch (e) {
198-
if (e instanceof Break)
198+
if (e == BreakException)
199199
break;
200-
if (e instanceof Continue)
200+
if (e == ContinueException)
201201
continue;
202202
throw e;
203203
}
@@ -212,9 +212,9 @@ class Evaluator extends Visitor {
212212
try {
213213
node.body.visit(this);
214214
} catch (e) {
215-
if (e instanceof Break)
215+
if (e == BreakException)
216216
break;
217-
if (e instanceof Continue)
217+
if (e == ContinueException)
218218
continue;
219219
throw e;
220220
}
@@ -223,12 +223,12 @@ class Evaluator extends Visitor {
223223

224224
visitBreak(node)
225225
{
226-
throw node;
226+
throw BreakException;
227227
}
228228

229229
visitContinue(node)
230230
{
231-
throw node;
231+
throw ContinueException;
232232
}
233233

234234
visitLetExpression(node)

0 commit comments

Comments
 (0)