-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation: deviations from JavaScript, fixes issue 226 (#281)
* fixes issue 226 * Remove chrome specific issue
- Loading branch information
1 parent
53c1acf
commit f2f1013
Showing
5 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,7 @@ | |
|
||
\input source_comments | ||
|
||
\input source_js_differences | ||
|
||
|
||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
\section*{Deviations from JavaScript} | ||
|
||
We intend the | ||
Source language to be a conservative extension | ||
of JavaScript: Every correct | ||
Source program should behave \emph{exactly} the same | ||
using a Source implementation, as it does using a JavaScript | ||
implementation. We assume, of course, that suitable libraries are | ||
used by the JavaScript implementation, to account for the predefined names | ||
of each Source language. | ||
|
||
This section lists some exceptions where we think a Source implementation | ||
should be allowed to deviate from the JavaScript specification, for the | ||
sake of internal consistency and esthetics. | ||
|
||
\begin{description} | ||
\item[Empty block as last statement of toplevel sequence:] In JavaScript, | ||
empty blocks as last statement of a sequence are apparently | ||
ignored. Thus the result of evaluating such a sequence is the | ||
result of evaluating the previous statement. Implementations | ||
of Source might stick to the more intuitive result: \texttt{undefined}. | ||
Example: | ||
\begin{lstlisting} | ||
1; | ||
{ | ||
// empty block | ||
} | ||
\end{lstlisting} | ||
The result of evaluating this program can be \texttt{undefined} | ||
for implementations of Source. Note that this issue only arises | ||
at the toplevel---outside of functions. | ||
\end{description} |