Skip to content

Commit f2f1013

Browse files
authored
Documentation: deviations from JavaScript, fixes issue 226 (#281)
* fixes issue 226 * Remove chrome specific issue
1 parent 53c1acf commit f2f1013

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

doc/source_1.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@
2727

2828
\input source_comments
2929

30+
\input source_js_differences
31+
32+
3033
\end{document}

doc/source_2.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ \section*{Changes}
3737

3838
\input source_comments
3939

40+
\input source_js_differences
41+
4042
\newpage
4143

4244
\input source_list_library

doc/source_3.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ \section*{Changes}
5757

5858
\input source_comments
5959

60+
\input source_js_differences
61+
6062
\newpage
6163

6264
\input source_list_library

doc/source_4.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ \section*{Changes}
5151

5252
\input source_comments
5353

54+
\input source_js_differences
55+
5456
\newpage
5557

5658
\input source_list_library

doc/source_js_differences.tex

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
\section*{Deviations from JavaScript}
2+
3+
We intend the
4+
Source language to be a conservative extension
5+
of JavaScript: Every correct
6+
Source program should behave \emph{exactly} the same
7+
using a Source implementation, as it does using a JavaScript
8+
implementation. We assume, of course, that suitable libraries are
9+
used by the JavaScript implementation, to account for the predefined names
10+
of each Source language.
11+
12+
This section lists some exceptions where we think a Source implementation
13+
should be allowed to deviate from the JavaScript specification, for the
14+
sake of internal consistency and esthetics.
15+
16+
\begin{description}
17+
\item[Empty block as last statement of toplevel sequence:] In JavaScript,
18+
empty blocks as last statement of a sequence are apparently
19+
ignored. Thus the result of evaluating such a sequence is the
20+
result of evaluating the previous statement. Implementations
21+
of Source might stick to the more intuitive result: \texttt{undefined}.
22+
Example:
23+
\begin{lstlisting}
24+
1;
25+
{
26+
// empty block
27+
}
28+
\end{lstlisting}
29+
The result of evaluating this program can be \texttt{undefined}
30+
for implementations of Source. Note that this issue only arises
31+
at the toplevel---outside of functions.
32+
\end{description}

0 commit comments

Comments
 (0)