Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_nashorn
提交
c4b57c25
D
dragonwell8_nashorn
项目概览
openanolis
/
dragonwell8_nashorn
通知
1
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_nashorn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c4b57c25
编写于
4月 24, 2020
作者:
A
andrew
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
475cd3ef
f09ebe71
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
8 deletion
+22
-8
.hgtags
.hgtags
+2
-0
src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java
src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java
+3
-3
src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java
src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java
+3
-3
src/jdk/nashorn/internal/runtime/regexp/joni/ast/StringNode.java
.../nashorn/internal/runtime/regexp/joni/ast/StringNode.java
+14
-2
未找到文件。
.hgtags
浏览文件 @
c4b57c25
...
...
@@ -1070,3 +1070,5 @@ e767af0b6500d829977e23cfb3fe19f28a4e9f88 jdk8u252-b04
b988f627520c45015f0b91d2ee35e69531300770 jdk8u252-b06
0666ec7fe2b45353dc0e09c1f6f386bdf763eeb4 jdk8u252-b07
95d61d0f326bbfaddc2cbd29e67b12c00041caaa jdk8u252-b08
2f5ad880fd3372eb5c2e5ac5ee82c705a1b6ac07 jdk8u252-b09
2f5ad880fd3372eb5c2e5ac5ee82c705a1b6ac07 jdk8u252-ga
src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java
浏览文件 @
c4b57c25
/*
* Copyright (c) 2010, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 201
9
, 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
;
}
...
...
src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java
浏览文件 @
c4b57c25
...
...
@@ -452,7 +452,7 @@ class Parser extends Lexer {
private
Node
parseExp
(
final
TokenType
term
)
{
if
(
token
.
type
==
term
)
{
return
StringNode
.
EMPTY
;
// goto end_of_token
return
StringNode
.
createEmpty
()
;
// goto end_of_token
}
Node
node
=
null
;
...
...
@@ -461,7 +461,7 @@ class Parser extends Lexer {
switch
(
token
.
type
)
{
case
ALT:
case
EOT:
return
StringNode
.
EMPTY
;
// end_of_token:, node_new_empty
return
StringNode
.
createEmpty
()
;
// end_of_token:, node_new_empty
case
SUBEXP_OPEN:
node
=
parseEnclose
(
TokenType
.
SUBEXP_CLOSE
);
...
...
@@ -569,7 +569,7 @@ class Parser extends Lexer {
if
(
syntax
.
contextInvalidRepeatOps
())
{
throw
new
SyntaxException
(
ERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED
);
}
node
=
StringNode
.
EMPTY
;
// node_new_empty
node
=
StringNode
.
createEmpty
()
;
// node_new_empty
}
else
{
return
parseExpTkByte
(
group
);
// goto tk_byte
}
...
...
src/jdk/nashorn/internal/runtime/regexp/joni/ast/StringNode.java
浏览文件 @
c4b57c25
...
...
@@ -27,7 +27,6 @@ public final class StringNode extends Node implements StringType {
private
static
final
int
NODE_STR_MARGIN
=
16
;
private
static
final
int
NODE_STR_BUF_SIZE
=
24
;
public
static
final
StringNode
EMPTY
=
new
StringNode
(
null
,
Integer
.
MAX_VALUE
,
Integer
.
MAX_VALUE
);
public
char
[]
chars
;
public
int
p
;
...
...
@@ -36,7 +35,13 @@ public final class StringNode extends Node implements StringType {
public
int
flag
;
public
StringNode
()
{
this
.
chars
=
new
char
[
NODE_STR_BUF_SIZE
];
this
(
NODE_STR_BUF_SIZE
);
}
private
StringNode
(
int
size
)
{
this
.
chars
=
new
char
[
size
];
this
.
p
=
0
;
this
.
end
=
0
;
}
public
StringNode
(
final
char
[]
chars
,
final
int
p
,
final
int
end
)
{
...
...
@@ -51,6 +56,13 @@ public final class StringNode extends Node implements StringType {
chars
[
end
++]
=
c
;
}
/**
* Create a new empty StringNode.
*/
public
static
StringNode
createEmpty
()
{
return
new
StringNode
(
0
);
}
/* Ensure there is ahead bytes available in node's buffer
* (assumes that the node is not shared)
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录