-
Notifications
You must be signed in to change notification settings - Fork 1
/
boop.diff
90 lines (84 loc) · 5.85 KB
/
boop.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff --git a/README.md b/README.md
index 9f585dc6366f..6b53420672d0 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,41 @@
-# Compiler Compiler SpiderMonkey Playground
+# Compiler Compiler BUG [#1286997](https://bugzilla.mozilla.org/show_bug.cgi?id=1286997)
+
+This bug playground covers stream [episodes 1-6](https://www.youtube.com/playlist?list=PLo3w8EB99pqJVPhmYbYdInBvAGarDavh-).
+
+The bug is captured by this test262 test: https://test262.report/browse/language/expressions/prefix-increment/S11.4.4_A6_T2.js
+
+The core problem is that in Spidermonkey, the expressions `obj[key]++` evaluates differently than
+`obj[key]`. We can see this happen if we throw an error instead of key.
+
+First, build spidermonkey by [following these instructions](https://firefox-source-docs.mozilla.org/js/build.html).
+
+To run one of the tests for this, try this command in your console. `./mach jstest --shell js/src/build_DBG.OBJ/dist/bin/js
+postfix`.
+
+To see the solution for this, you can look through these patches:
+
+* [initial implementation](https://hg.mozilla.org/try/rev/37e07f6d9efb6c0e4c3fdb57f556797ed0a16f95)
+* [implementing compound assignment](https://hg.mozilla.org/try/rev/65b2659ee1ed8a1fb56981f455fa7e5e1bc4241c)
+* [implementing the bytecode in the interpreter](https://hg.mozilla.org/try/rev/afea27bde17d593b2e8d36d2ca9b96fd6bdd4e5a)
+* [implementing the bytecode in Baseline p1](https://hg.mozilla.org/try/rev/5a40802637bd056b31715599c45a19268b60ea0d)
+* [implementing the bytecode in Baseline p2 (corrections)](https://hg.mozilla.org/try/rev/3670e05fb48261683a671d46160cb54f1529e02c)
+* [implementing the bytecode in Ion](https://hg.mozilla.org/try/rev/d00744e7819961c5e6c964eb09b3977532cbe958)
+
+-----
+
+Original text:
![img](https://pbs.twimg.com/media/EcZ_esIWsAAIrs8?format=jpg&name=large)
-Welcome! You are likely here as part of the [Compiler Compiler Stream](https://www.twitch.tv/codehag). This repository is a space for you to try out what
+Welcome! You are likely here as part of the [Compiler Compiler Stream](https://www.twitch.tv/codehag). This repository is a space for you to try out what
you learned, by replicating bugs that are covered in the stream.
-What this repository is -> A complete copy of the Firefox codebase, including Spidermonkey. For our purposes, we are mostly interested in the `js` directory. Why the whole browser? It is a long story but basically it is difficult to completely separate Spidermonkey from Gecko and other Firefox components.
+What this repository is -> A complete copy of the Firefox codebase, including Spidermonkey. For our purposes, we are mostly interested in the `js` directory. Why the whole browser? It is a long story but basically it is difficult to completely separate Spidermonkey from Gecko and other Firefox components.
Important technical stuff -> [Follow these instructions](https://firefox-source-docs.mozilla.org/js/build.html) in order to build SpiderMonkey. If you have problems,
-create an issue.
+create an issue.
-This repository is organized around branches. Each branch enables a test that will fail when you try to run it. Information about the bug will be found in the
+This repository is organized around branches. Each branch enables a test that will fail when you try to run it. Information about the bug will be found in the
README.md of that branch, so you will always know what you need to do, along with what kind of challenges you can expect on the way.
Once you finish a bug, you can open a pull request and have it marked. It won't be merged, it will just be marked as correct. If you have any issues or questions, please open an issue and I will try to answer. Also
diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list
index e12a489da6eb..0b94de752f89 100644
--- a/js/src/tests/jstests.list
+++ b/js/src/tests/jstests.list
@@ -237,17 +237,26 @@ skip script test262/language/expressions/compound-assignment/S11.13.2_A7.8_T2.js
skip script test262/language/expressions/compound-assignment/S11.13.2_A7.9_T1.js
skip script test262/language/expressions/compound-assignment/S11.13.2_A7.9_T2.js
skip script test262/language/expressions/postfix-decrement/S11.3.2_A5_T5.js
-skip script test262/language/expressions/postfix-decrement/S11.3.2_A6_T1.js
-skip script test262/language/expressions/postfix-decrement/S11.3.2_A6_T2.js
+
+# BUG TEST CODE!
+script test262/language/expressions/postfix-decrement/S11.3.2_A6_T1.js
+script test262/language/expressions/postfix-decrement/S11.3.2_A6_T2.js
+
skip script test262/language/expressions/postfix-increment/S11.3.1_A5_T5.js
-skip script test262/language/expressions/postfix-increment/S11.3.1_A6_T1.js
-skip script test262/language/expressions/postfix-increment/S11.3.1_A6_T2.js
+
+script test262/language/expressions/postfix-increment/S11.3.1_A6_T1.js
+script test262/language/expressions/postfix-increment/S11.3.1_A6_T2.js
+
skip script test262/language/expressions/prefix-decrement/S11.4.5_A5_T5.js
-skip script test262/language/expressions/prefix-decrement/S11.4.5_A6_T1.js
-skip script test262/language/expressions/prefix-decrement/S11.4.5_A6_T2.js
+
+script test262/language/expressions/prefix-decrement/S11.4.5_A6_T1.js
+script test262/language/expressions/prefix-decrement/S11.4.5_A6_T2.js
+
skip script test262/language/expressions/prefix-increment/S11.4.4_A5_T5.js
-skip script test262/language/expressions/prefix-increment/S11.4.4_A6_T1.js
-skip script test262/language/expressions/prefix-increment/S11.4.4_A6_T2.js
+
+script test262/language/expressions/prefix-increment/S11.4.4_A6_T1.js
+script test262/language/expressions/prefix-increment/S11.4.4_A6_T2.js
+
skip script test262/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-lhs-before-rhs.js
skip script test262/language/expressions/logical-assignment/lgcl-and-assignment-operator-lhs-before-rhs.js
skip script test262/language/expressions/logical-assignment/lgcl-or-assignment-operator-lhs-before-rhs.js