Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_nashorn
提交
e2e004f7
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,发现更多精彩内容 >>
提交
e2e004f7
编写于
12月 09, 2013
作者:
S
sundar
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
0d398b72
48041c86
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
23 deletion
+21
-23
src/jdk/nashorn/internal/objects/Global.java
src/jdk/nashorn/internal/objects/Global.java
+17
-0
src/jdk/nashorn/internal/objects/NativeStrictArguments.java
src/jdk/nashorn/internal/objects/NativeStrictArguments.java
+1
-1
src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java
src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java
+3
-22
未找到文件。
src/jdk/nashorn/internal/objects/Global.java
浏览文件 @
e2e004f7
...
...
@@ -44,6 +44,7 @@ import java.util.concurrent.Callable;
import
java.util.concurrent.ConcurrentHashMap
;
import
jdk.internal.dynalink.linker.GuardedInvocation
;
import
jdk.internal.dynalink.linker.LinkRequest
;
import
jdk.nashorn.internal.lookup.Lookup
;
import
jdk.nashorn.internal.objects.annotations.Attribute
;
import
jdk.nashorn.internal.objects.annotations.Property
;
import
jdk.nashorn.internal.objects.annotations.ScriptClass
;
...
...
@@ -364,6 +365,11 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
private
ScriptObject
builtinFloat32Array
;
private
ScriptObject
builtinFloat64Array
;
/*
* ECMA section 13.2.3 The [[ThrowTypeError]] Function Object
*/
private
ScriptFunction
typeErrorThrower
;
private
PropertyMap
accessorPropertyDescriptorMap
;
private
PropertyMap
arrayBufferViewMap
;
private
PropertyMap
dataPropertyDescriptorMap
;
...
...
@@ -1114,6 +1120,10 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
return
builtinArray
;
}
ScriptFunction
getTypeErrorThrower
()
{
return
typeErrorThrower
;
}
/**
* Called from compiled script code to test if builtin has been overridden
*
...
...
@@ -2000,6 +2010,13 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
anon
.
set
(
"constructor"
,
builtinFunction
,
false
);
anon
.
deleteOwnProperty
(
anon
.
getMap
().
findProperty
(
"prototype"
));
// use "getter" so that [[ThrowTypeError]] function's arity is 0 - as specified in step 10 of section 13.2.3
this
.
typeErrorThrower
=
new
ScriptFunctionImpl
(
"TypeErrorThrower"
,
Lookup
.
TYPE_ERROR_THROWER_GETTER
,
null
,
null
,
false
,
false
,
false
);
typeErrorThrower
.
setPrototype
(
UNDEFINED
);
// Non-constructor built-in functions do not have "prototype" property
typeErrorThrower
.
deleteOwnProperty
(
typeErrorThrower
.
getMap
().
findProperty
(
"prototype"
));
typeErrorThrower
.
preventExtensions
();
// now initialize Object
this
.
builtinObject
=
(
ScriptFunction
)
initConstructor
(
"Object"
);
final
ScriptObject
ObjectPrototype
=
getObjectPrototype
();
...
...
src/jdk/nashorn/internal/objects/NativeStrictArguments.java
浏览文件 @
e2e004f7
...
...
@@ -76,7 +76,7 @@ public final class NativeStrictArguments extends ScriptObject {
super
(
proto
,
map
);
setIsArguments
();
final
ScriptFunction
func
=
ScriptFunctionImpl
.
getTypeErrorThrower
();
final
ScriptFunction
func
=
Global
.
instance
()
.
getTypeErrorThrower
();
// We have to fill user accessor functions late as these are stored
// in this object rather than in the PropertyMap of this object.
setUserAccessors
(
"caller"
,
func
,
func
);
...
...
src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java
浏览文件 @
e2e004f7
...
...
@@ -170,26 +170,6 @@ public class ScriptFunctionImpl extends ScriptFunction {
boundfunctionmap
$
.
setIsShared
();
}
// function object representing TypeErrorThrower
private
static
ScriptFunction
typeErrorThrower
;
/*
* ECMA section 13.2.3 The [[ThrowTypeError]] Function Object
*/
static
synchronized
ScriptFunction
getTypeErrorThrower
()
{
if
(
typeErrorThrower
==
null
)
{
// use "getter" so that [[ThrowTypeError]] function's arity is 0 - as specified in step 10 of section 13.2.3
final
ScriptFunctionImpl
func
=
new
ScriptFunctionImpl
(
"TypeErrorThrower"
,
Lookup
.
TYPE_ERROR_THROWER_GETTER
,
null
,
null
,
false
,
false
,
false
);
func
.
setPrototype
(
UNDEFINED
);
// Non-constructor built-in functions do not have "prototype" property
func
.
deleteOwnProperty
(
func
.
getMap
().
findProperty
(
"prototype"
));
func
.
preventExtensions
();
typeErrorThrower
=
func
;
}
return
typeErrorThrower
;
}
private
static
PropertyMap
createStrictModeMap
(
final
PropertyMap
map
)
{
final
int
flags
=
Property
.
NOT_ENUMERABLE
|
Property
.
NOT_CONFIGURABLE
;
PropertyMap
newMap
=
map
;
...
...
@@ -313,12 +293,13 @@ public class ScriptFunctionImpl extends ScriptFunction {
// We have to fill user accessor functions late as these are stored
// in this object rather than in the PropertyMap of this object.
final
ScriptFunction
errorThrower
=
global
.
getTypeErrorThrower
();
if
(
findProperty
(
"arguments"
,
true
)
!=
null
)
{
setUserAccessors
(
"arguments"
,
getTypeErrorThrower
(),
getTypeErrorThrower
()
);
setUserAccessors
(
"arguments"
,
errorThrower
,
errorThrower
);
}
if
(
findProperty
(
"caller"
,
true
)
!=
null
)
{
setUserAccessors
(
"caller"
,
getTypeErrorThrower
(),
getTypeErrorThrower
()
);
setUserAccessors
(
"caller"
,
errorThrower
,
errorThrower
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录