8223898: Forward references to Nashorn

Reviewed-by: sundar, mschoene, rhalade
This commit is contained in:
Hannes Wallnöfer 2019-11-06 17:13:21 +01:00
parent 740e70ba17
commit 0e4b718a25

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -141,14 +141,14 @@ final class RegExpScanner extends Scanner {
throw new PatternSyntaxException(e.getMessage(), string, scanner.position);
}
scanner.processForwardReferences();
// Throw syntax error unless we parsed the entire JavaScript regexp without syntax errors
if (scanner.position != string.length()) {
final String p = scanner.getStringBuilder().toString();
throw new PatternSyntaxException(string, p, p.length() + 1);
}
scanner.processForwardReferences();
return scanner;
}