V8 works towards implementing the ECMAScript spec, which you can find at https://tc39.github.io/ecma262/ . It doesn't provide any compatibility modes for other versions of JavaScript shipped by particular browsers, or historical versions of JavaScript. In standard JS, the null byte is not a whitespace character, so it makes sense for V8 to throw a SyntaxError.
Dan On Thu, Mar 16, 2017 at 11:05 AM, Danny Dorfman <wilderness...@gmail.com> wrote: > Hello there, > > I have been given a script sample that contains a null character (ASCII > 0x00). > > <html> > <body> > <script> > alert("I am an alert box!"); > ^@ > </script> > </body> > </html> > > Obviously, this fails to compile and run, since this is not valid syntax > (I get "SyntaxError: Invalid or unexpected token"). > However, in IE this code just gives out a warning, and runs normally. > > Is it possible to simulate the IE behavior under V8 as well? > > Thanks in advance, > D. > > -- > -- > v8-users mailing list > v8-users@googlegroups.com > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to v8-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.