diff --git a/mozilla/js/js2/Makefile b/mozilla/js/js2/Makefile new file mode 100644 index 00000000000..c1aa1636d45 --- /dev/null +++ b/mozilla/js/js2/Makefile @@ -0,0 +1,22 @@ +CC = gcc +CFLAGS = -O -DDEBUG -DXP_UNIX -Wall -W -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes \ + -Wno-non-virtual-dtor + +objs = hash.o \ + js2.o \ + numerics.o \ + parser.o \ + utilities.o \ + world.o + +libs = -lstdc++ + + +%.o : %.cpp + $(CC) -c $(CFLAGS) $< -o $@ + +js2: $(objs) + $(CC) -o $@ $^ $(libs) + +clean: + rm -f $(objs) diff --git a/mozilla/js/js2/parser.cpp b/mozilla/js/js2/parser.cpp index 63842d56783..20acee5cc6e 100644 --- a/mozilla/js/js2/parser.cpp +++ b/mozilla/js/js2/parser.cpp @@ -572,7 +572,6 @@ bool JS::Lexer::lexIdentifier(String &s, bool allowLeadingDigit) // Return true if the numeric literal is followed by a unit, but don't read the unit yet. bool JS::Lexer::lexNumeral() { - int radix = 10; int hasDecimalPoint = 0; String &s = nextToken->chars; uint digit; @@ -936,6 +935,7 @@ void JS::Lexer::lexToken(bool preferRegExp) default: syntaxError("Bad character"); + return; } break; diff --git a/mozilla/js2/src/Makefile b/mozilla/js2/src/Makefile new file mode 100644 index 00000000000..c1aa1636d45 --- /dev/null +++ b/mozilla/js2/src/Makefile @@ -0,0 +1,22 @@ +CC = gcc +CFLAGS = -O -DDEBUG -DXP_UNIX -Wall -W -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes \ + -Wno-non-virtual-dtor + +objs = hash.o \ + js2.o \ + numerics.o \ + parser.o \ + utilities.o \ + world.o + +libs = -lstdc++ + + +%.o : %.cpp + $(CC) -c $(CFLAGS) $< -o $@ + +js2: $(objs) + $(CC) -o $@ $^ $(libs) + +clean: + rm -f $(objs) diff --git a/mozilla/js2/src/parser.cpp b/mozilla/js2/src/parser.cpp index 63842d56783..20acee5cc6e 100644 --- a/mozilla/js2/src/parser.cpp +++ b/mozilla/js2/src/parser.cpp @@ -572,7 +572,6 @@ bool JS::Lexer::lexIdentifier(String &s, bool allowLeadingDigit) // Return true if the numeric literal is followed by a unit, but don't read the unit yet. bool JS::Lexer::lexNumeral() { - int radix = 10; int hasDecimalPoint = 0; String &s = nextToken->chars; uint digit; @@ -936,6 +935,7 @@ void JS::Lexer::lexToken(bool preferRegExp) default: syntaxError("Bad character"); + return; } break;