Skip to content

Commit

Permalink
Documentation: deviations from JavaScript, fixes issue 226 (#281)
Browse files Browse the repository at this point in the history
* fixes issue 226

* Remove chrome specific issue
  • Loading branch information
martin-henz authored Aug 11, 2019
1 parent 53c1acf commit f2f1013
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/source_1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@

\input source_comments

\input source_js_differences


\end{document}
2 changes: 2 additions & 0 deletions doc/source_2.tex
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ \section*{Changes}

\input source_comments

\input source_js_differences

\newpage

\input source_list_library
Expand Down
2 changes: 2 additions & 0 deletions doc/source_3.tex
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ \section*{Changes}

\input source_comments

\input source_js_differences

\newpage

\input source_list_library
Expand Down
2 changes: 2 additions & 0 deletions doc/source_4.tex
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ \section*{Changes}

\input source_comments

\input source_js_differences

\newpage

\input source_list_library
Expand Down
32 changes: 32 additions & 0 deletions doc/source_js_differences.tex
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}

0 comments on commit f2f1013

Please sign in to comment.