Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_nashorn
提交
ec9a4658
D
dragonwell8_nashorn
项目概览
openanolis
/
dragonwell8_nashorn
通知
2
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,发现更多精彩内容 >>
提交
ec9a4658
编写于
7月 26, 2017
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
c0290149
82afbdff
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
83 addition
and
7 deletion
+83
-7
.hgtags
.hgtags
+24
-0
src/jdk/nashorn/internal/objects/NativeDataView.java
src/jdk/nashorn/internal/objects/NativeDataView.java
+7
-7
test/script/basic/JDK-8181191.js
test/script/basic/JDK-8181191.js
+52
-0
未找到文件。
.hgtags
浏览文件 @
ec9a4658
...
...
@@ -701,6 +701,8 @@ e47b42f887ba51e27db2a9882eb10d2ee16830aa jdk8u141-b10
2c1a74bca789006be1cc7fc642048ade06fef2f2 jdk8u141-b13
8c329eab0dac3630854a56f2485f9862040bffdf jdk8u141-b14
dfb2e076f381c4ea8c84ae0309a2072ec3ac92b8 jdk8u141-b15
6a52d202dfa3395d90cdd7dc24b8c437e5acc03d jdk8u144-b00
7de0a688b0d910d4ef2cb89da6623b3ded431276 jdk8u144-b01
6f50b0c7c275324f76cf7f09606949195fd65f92 jdk8u141-b31
59bf0950e077f66d1f6c5ef4a3f1489b2b2048fa jdk8u141-b32
6a5473932aff2d9c0df2cdc6e1800dd7c374232f jdk8u151-b00
...
...
@@ -708,6 +710,28 @@ dfb2e076f381c4ea8c84ae0309a2072ec3ac92b8 jdk8u141-b15
296b5f81b2c28b5d7eea4a7051eae0ec34f5ec05 jdk8u151-b02
c0828d5abc8646c80236fae42d971477bfc74748 jdk8u151-b03
a593aff280ac5472a23923604f1a25c8e80e6ec7 jdk8u151-b04
178207e92304e6717c1b2e80c56424efe4e69204 jdk8u151-b05
b9ed966e2b873528553e27a791298205e1bc7cb5 jdk8u151-b06
18eb73eb84c5395b3efcafa43ce224565eca02b3 jdk8u122-b00
9e615ea961fe5732813ed7b273606e7337ea2234 jdk8u122-b01
2f0b11882cb7ddb10e35682ab9e8343919a71c54 jdk8u122-b02
df2a2824284f97c5edb9b9c2e6d18bb4ff838199 jdk8u122-b03
df2a2824284f97c5edb9b9c2e6d18bb4ff838199 jdk8u122-b03
0000000000000000000000000000000000000000 jdk8u122-b03
0000000000000000000000000000000000000000 jdk8u122-b03
12650d23a8fd1b27a0d28c6a276fdecf01805294 jdk8u122-b03
3c3b4e793e7c6255a840844db077ef466940035c jdk8u122-b04
30dc0c72f3d0aff34b6d421208b18f384d05d761 jdk8u132-b00
91d33aea2714e63796eeab0e63e38c9d2568c00c jdk8u152-b00
50dac2fd8689dbb820d887ce3919708d5d042891 jdk8u152-b01
01bbd310156db7a75a46a7320d1f49beff844472 jdk8u152-b02
2a01d94fea9a86b4038a93622f62b0986083f67e jdk8u152-b03
9dce75561a92f096d822ebb7eb76810f191fe522 jdk8u152-b04
cdb7d9454d254e95c73d6dc77077ab2c198e2ad6 jdk8u152-b05
2be667f12b54fc5b57b147f60851ee63ff02e5fa jdk8u152-b06
a44dcdfa00bee9261012f10bd3f06bea1fec4340 jdk8u152-b07
d0a8151a276c362a6e17068d9aa8ed583309d46e jdk8u152-b08
37e94d764d7b98e3676e54f2ad346d721fdde113 jdk8u152-b09
18eb73eb84c5395b3efcafa43ce224565eca02b3 jdk8u122-b00
9e615ea961fe5732813ed7b273606e7337ea2234 jdk8u122-b01
2f0b11882cb7ddb10e35682ab9e8343919a71c54 jdk8u122-b02
...
...
src/jdk/nashorn/internal/objects/NativeDataView.java
浏览文件 @
ec9a4658
...
...
@@ -416,7 +416,7 @@ public class NativeDataView extends ScriptObject {
* @return 32-bit unsigned int value at the byteOffset
*/
@Function
(
attributes
=
Attribute
.
NOT_ENUMERABLE
,
arity
=
1
)
public
static
long
getUint32
(
final
Object
self
,
final
Object
byteOffset
,
final
Object
littleEndian
)
{
public
static
double
getUint32
(
final
Object
self
,
final
Object
byteOffset
,
final
Object
littleEndian
)
{
try
{
return
0xFFFFFFFF
L
&
getBuffer
(
self
,
littleEndian
).
getInt
(
JSType
.
toInt32
(
byteOffset
));
}
catch
(
final
IllegalArgumentException
iae
)
{
...
...
@@ -432,7 +432,7 @@ public class NativeDataView extends ScriptObject {
* @return 32-bit unsigned int value at the byteOffset
*/
@SpecializedFunction
public
static
long
getUint32
(
final
Object
self
,
final
int
byteOffset
)
{
public
static
double
getUint32
(
final
Object
self
,
final
int
byteOffset
)
{
try
{
return
JSType
.
toUint32
(
getBuffer
(
self
,
false
).
getInt
(
JSType
.
toInt32
(
byteOffset
)));
}
catch
(
final
IllegalArgumentException
iae
)
{
...
...
@@ -449,7 +449,7 @@ public class NativeDataView extends ScriptObject {
* @return 32-bit unsigned int value at the byteOffset
*/
@SpecializedFunction
public
static
long
getUint32
(
final
Object
self
,
final
int
byteOffset
,
final
boolean
littleEndian
)
{
public
static
double
getUint32
(
final
Object
self
,
final
int
byteOffset
,
final
boolean
littleEndian
)
{
try
{
return
JSType
.
toUint32
(
getBuffer
(
self
,
littleEndian
).
getInt
(
JSType
.
toInt32
(
byteOffset
)));
}
catch
(
final
IllegalArgumentException
iae
)
{
...
...
@@ -837,9 +837,9 @@ public class NativeDataView extends ScriptObject {
* @return undefined
*/
@SpecializedFunction
public
static
Object
setUint32
(
final
Object
self
,
final
int
byteOffset
,
final
long
value
)
{
public
static
Object
setUint32
(
final
Object
self
,
final
int
byteOffset
,
final
double
value
)
{
try
{
getBuffer
(
self
,
false
).
putInt
(
byteOffset
,
(
int
)
value
);
getBuffer
(
self
,
false
).
putInt
(
byteOffset
,
(
int
)
JSType
.
toUint32
(
value
)
);
return
UNDEFINED
;
}
catch
(
final
IllegalArgumentException
iae
)
{
throw
rangeError
(
iae
,
"dataview.offset"
);
...
...
@@ -856,9 +856,9 @@ public class NativeDataView extends ScriptObject {
* @return undefined
*/
@SpecializedFunction
public
static
Object
setUint32
(
final
Object
self
,
final
int
byteOffset
,
final
long
value
,
final
boolean
littleEndian
)
{
public
static
Object
setUint32
(
final
Object
self
,
final
int
byteOffset
,
final
double
value
,
final
boolean
littleEndian
)
{
try
{
getBuffer
(
self
,
littleEndian
).
putInt
(
byteOffset
,
(
int
)
value
);
getBuffer
(
self
,
littleEndian
).
putInt
(
byteOffset
,
(
int
)
JSType
.
toUint32
(
value
)
);
return
UNDEFINED
;
}
catch
(
final
IllegalArgumentException
iae
)
{
throw
rangeError
(
iae
,
"dataview.offset"
);
...
...
test/script/basic/JDK-8181191.js
0 → 100644
浏览文件 @
ec9a4658
/*
* Copyright (c) 2017, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* JDK-8181191: getUint32 returning Long
*
* @test
* @run
*/
function
uint32
(
x
)
{
var
buffer
=
new
ArrayBuffer
(
16
);
var
dataview
=
new
DataView
(
buffer
);
dataview
.
setUint32
(
0
,
x
);
return
dataview
.
getUint32
(
0
);
}
Assert
.
assertTrue
(
typeof
uint32
(
0x7f
)
===
'
number
'
);
Assert
.
assertTrue
(
typeof
uint32
(
0x80
)
===
'
number
'
);
Assert
.
assertTrue
(
typeof
uint32
(
0xffffffff
)
===
'
number
'
);
Assert
.
assertTrue
(
typeof
uint32
(
0x100000000
)
===
'
number
'
);
Assert
.
assertTrue
(
uint32
(
0x7f
)
===
0x7f
);
Assert
.
assertTrue
(
uint32
(
0x80
)
===
0x80
);
Assert
.
assertTrue
(
uint32
(
0xffffffff
)
===
0xffffffff
);
Assert
.
assertTrue
(
uint32
(
0x100000000
)
===
0x0
);
Assert
.
assertTrue
(
uint32
(
0x7f
)
===
uint32
(
0x7f
));
Assert
.
assertTrue
(
uint32
(
0x80
)
===
uint32
(
0x80
));
Assert
.
assertTrue
(
uint32
(
0xffffffff
)
===
uint32
(
0xffffffff
));
Assert
.
assertTrue
(
uint32
(
0x100000000
)
===
uint32
(
0x100000000
));
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录