本文整理汇总了Java中jdk.nashorn.internal.objects.annotations.Property类的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Property类属于jdk.nashorn.internal.objects.annotations包,在下文中一共展示了Property类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: extractBuiltinProperties
import jdk.nashorn.internal.objects.annotations.Property; //导入依赖的package包/类
private List<jdk.nashorn.internal.runtime.Property> extractBuiltinProperties(final String name, final ScriptObject func) {
final List<jdk.nashorn.internal.runtime.Property> list = new ArrayList<>();
list.addAll(Arrays.asList(func.getMap().getProperties()));
if (func instanceof ScriptFunction) {
final ScriptObject proto = ScriptFunction.getPrototype((ScriptFunction)func);
if (proto != null) {
list.addAll(Arrays.asList(proto.getMap().getProperties()));
}
}
final jdk.nashorn.internal.runtime.Property prop = getProperty(name);
if (prop != null) {
list.add(prop);
}
return list;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:Global.java
示例2: tagBuiltinProperties
import jdk.nashorn.internal.objects.annotations.Property; //导入依赖的package包/类
/**
* Given a builtin object, traverse its properties recursively and associate them with a name that
* will be a key to their invalidation switchpoint.
* @param name name for key
* @param func builtin script object
*/
private void tagBuiltinProperties(final String name, final ScriptObject func) {
SwitchPoint sp = context.getBuiltinSwitchPoint(name);
if (sp == null) {
sp = context.newBuiltinSwitchPoint(name);
}
//get all builtin properties in this builtin object and register switchpoints keyed on the propery name,
//one overwrite destroys all for now, e.g. Function.prototype.apply = 17; also destroys Function.prototype.call etc
for (final jdk.nashorn.internal.runtime.Property prop : extractBuiltinProperties(name, func)) {
prop.setBuiltinSwitchPoint(sp);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Global.java
示例3: addBoundProperties
import jdk.nashorn.internal.objects.annotations.Property; //导入依赖的package包/类
@Override
public void addBoundProperties(final ScriptObject source, final jdk.nashorn.internal.runtime.Property[] properties) {
PropertyMap ownMap = getMap();
LexicalScope lexicalScope = null;
PropertyMap lexicalMap = null;
boolean hasLexicalDefinitions = false;
if (context.getEnv()._es6) {
lexicalScope = (LexicalScope) getLexicalScope();
lexicalMap = lexicalScope.getMap();
for (final jdk.nashorn.internal.runtime.Property property : properties) {
if (property.isLexicalBinding()) {
hasLexicalDefinitions = true;
}
// ES6 15.1.8 steps 6. and 7.
final jdk.nashorn.internal.runtime.Property globalProperty = ownMap.findProperty(property.getKey());
if (globalProperty != null && !globalProperty.isConfigurable() && property.isLexicalBinding()) {
throw ECMAErrors.syntaxError("redeclare.variable", property.getKey());
}
final jdk.nashorn.internal.runtime.Property lexicalProperty = lexicalMap.findProperty(property.getKey());
if (lexicalProperty != null && !property.isConfigurable()) {
throw ECMAErrors.syntaxError("redeclare.variable", property.getKey());
}
}
}
for (final jdk.nashorn.internal.runtime.Property property : properties) {
if (property.isLexicalBinding()) {
assert lexicalScope != null;
lexicalMap = lexicalScope.addBoundProperty(lexicalMap, source, property);
if (ownMap.findProperty(property.getKey()) != null) {
// If property exists in the global object invalidate any global constant call sites.
invalidateGlobalConstant(property.getKey());
}
} else {
ownMap = addBoundProperty(ownMap, source, property);
}
}
setMap(ownMap);
if (hasLexicalDefinitions) {
lexicalScope.setMap(lexicalMap);
invalidateLexicalSwitchPoint();
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:49,代码来源:Global.java
示例4: addBoundProperty
import jdk.nashorn.internal.objects.annotations.Property; //导入依赖的package包/类
@Override
protected PropertyMap addBoundProperty(final PropertyMap propMap, final ScriptObject source, final jdk.nashorn.internal.runtime.Property property) {
// We override this method just to make it callable by Global
return super.addBoundProperty(propMap, source, property);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:Global.java
示例5: addBoundProperties
import jdk.nashorn.internal.objects.annotations.Property; //导入依赖的package包/类
@Override
public void addBoundProperties(final ScriptObject source, final jdk.nashorn.internal.runtime.Property[] properties) {
PropertyMap ownMap = getMap();
LexicalScope lexScope = null;
PropertyMap lexicalMap = null;
boolean hasLexicalDefinitions = false;
if (context.getEnv()._es6) {
lexScope = (LexicalScope) getLexicalScope();
lexicalMap = lexScope.getMap();
for (final jdk.nashorn.internal.runtime.Property property : properties) {
if (property.isLexicalBinding()) {
hasLexicalDefinitions = true;
}
// ES6 15.1.8 steps 6. and 7.
final jdk.nashorn.internal.runtime.Property globalProperty = ownMap.findProperty(property.getKey());
if (globalProperty != null && !globalProperty.isConfigurable() && property.isLexicalBinding()) {
throw ECMAErrors.syntaxError("redeclare.variable", property.getKey().toString());
}
final jdk.nashorn.internal.runtime.Property lexicalProperty = lexicalMap.findProperty(property.getKey());
if (lexicalProperty != null && !property.isConfigurable()) {
throw ECMAErrors.syntaxError("redeclare.variable", property.getKey().toString());
}
}
}
final boolean extensible = isExtensible();
for (final jdk.nashorn.internal.runtime.Property property : properties) {
if (property.isLexicalBinding()) {
assert lexScope != null;
lexicalMap = lexScope.addBoundProperty(lexicalMap, source, property, true);
if (ownMap.findProperty(property.getKey()) != null) {
// If property exists in the global object invalidate any global constant call sites.
invalidateGlobalConstant(property.getKey());
}
} else {
ownMap = addBoundProperty(ownMap, source, property, extensible);
}
}
setMap(ownMap);
if (hasLexicalDefinitions) {
assert lexScope != null;
lexScope.setMap(lexicalMap);
invalidateLexicalSwitchPoint();
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:51,代码来源:Global.java
示例6: addBoundProperty
import jdk.nashorn.internal.objects.annotations.Property; //导入依赖的package包/类
@Override
protected PropertyMap addBoundProperty(final PropertyMap propMap, final ScriptObject source, final jdk.nashorn.internal.runtime.Property property, final boolean extensible) {
// We override this method just to make it callable by Global
return super.addBoundProperty(propMap, source, property, extensible);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:Global.java
示例7: addBoundProperties
import jdk.nashorn.internal.objects.annotations.Property; //导入依赖的package包/类
@Override
public void addBoundProperties(final ScriptObject source, final jdk.nashorn.internal.runtime.Property[] properties) {
PropertyMap ownMap = getMap();
LexicalScope lexScope = null;
PropertyMap lexicalMap = null;
boolean hasLexicalDefinitions = false;
if (context.getEnv()._es6) {
lexScope = (LexicalScope) getLexicalScope();
lexicalMap = lexScope.getMap();
for (final jdk.nashorn.internal.runtime.Property property : properties) {
if (property.isLexicalBinding()) {
hasLexicalDefinitions = true;
}
// ES6 15.1.8 steps 6. and 7.
final jdk.nashorn.internal.runtime.Property globalProperty = ownMap.findProperty(property.getKey());
if (globalProperty != null && !globalProperty.isConfigurable() && property.isLexicalBinding()) {
throw ECMAErrors.syntaxError("redeclare.variable", property.getKey());
}
final jdk.nashorn.internal.runtime.Property lexicalProperty = lexicalMap.findProperty(property.getKey());
if (lexicalProperty != null && !property.isConfigurable()) {
throw ECMAErrors.syntaxError("redeclare.variable", property.getKey());
}
}
}
for (final jdk.nashorn.internal.runtime.Property property : properties) {
if (property.isLexicalBinding()) {
assert lexScope != null;
lexicalMap = lexScope.addBoundProperty(lexicalMap, source, property);
if (ownMap.findProperty(property.getKey()) != null) {
// If property exists in the global object invalidate any global constant call sites.
invalidateGlobalConstant(property.getKey());
}
} else {
ownMap = addBoundProperty(ownMap, source, property);
}
}
setMap(ownMap);
if (hasLexicalDefinitions) {
assert lexScope != null;
lexScope.setMap(lexicalMap);
invalidateLexicalSwitchPoint();
}
}
开发者ID:malaporte,项目名称:kaziranga,代码行数:50,代码来源:Global.java
示例8: addBoundProperties
import jdk.nashorn.internal.objects.annotations.Property; //导入依赖的package包/类
@Override
public void addBoundProperties(final ScriptObject source, final jdk.nashorn.internal.runtime.Property[] properties) {
PropertyMap ownMap = getMap();
LexicalScope lexScope = null;
PropertyMap lexicalMap = null;
boolean hasLexicalDefinitions = false;
if (context.getEnv()._es6) {
lexScope = (LexicalScope) getLexicalScope();
lexicalMap = lexScope.getMap();
for (final jdk.nashorn.internal.runtime.Property property : properties) {
if (property.isLexicalBinding()) {
hasLexicalDefinitions = true;
}
// ES6 15.1.8 steps 6. and 7.
final jdk.nashorn.internal.runtime.Property globalProperty = ownMap.findProperty(property.getKey());
if (globalProperty != null && !globalProperty.isConfigurable() && property.isLexicalBinding()) {
throw ECMAErrors.syntaxError("redeclare.variable", property.getKey());
}
final jdk.nashorn.internal.runtime.Property lexicalProperty = lexicalMap.findProperty(property.getKey());
if (lexicalProperty != null && !property.isConfigurable()) {
throw ECMAErrors.syntaxError("redeclare.variable", property.getKey());
}
}
}
final boolean extensible = isExtensible();
for (final jdk.nashorn.internal.runtime.Property property : properties) {
if (property.isLexicalBinding()) {
assert lexScope != null;
lexicalMap = lexScope.addBoundProperty(lexicalMap, source, property, true);
if (ownMap.findProperty(property.getKey()) != null) {
// If property exists in the global object invalidate any global constant call sites.
invalidateGlobalConstant(property.getKey());
}
} else {
ownMap = addBoundProperty(ownMap, source, property, extensible);
}
}
setMap(ownMap);
if (hasLexicalDefinitions) {
assert lexScope != null;
lexScope.setMap(lexicalMap);
invalidateLexicalSwitchPoint();
}
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:51,代码来源:Global.java
注:本文中的jdk.nashorn.internal.objects.annotations.Property类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论