This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch improvements/Language
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/improvements/Language by this
push:
new 4dade1a remove 'no' from new config settings and toggle defaults
accordingly (group review decision)
4dade1a is described below
commit 4dade1a0500767a35b051829ebf2908254f22438
Author: greg-dove <[email protected]>
AuthorDate: Tue May 7 17:57:32 2019 +1200
remove 'no' from new config settings and toggle defaults accordingly (group
review decision)
---
.../royale/compiler/clients/JSConfiguration.java | 44 +++++++++++-----------
.../compiler/internal/codegen/js/JSEmitter.java | 6 +--
.../codegen/js/jx/DynamicAccessEmitter.java | 7 +---
.../codegen/js/jx/FunctionCallEmitter.java | 7 +---
4 files changed, 27 insertions(+), 37 deletions(-)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java
index ae06bf7..e41a867 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/JSConfiguration.java
@@ -464,18 +464,18 @@ public class JSConfiguration extends Configuration
//
- // 'js-no-complex-implicit-coercions'
+ // 'js-complex-implicit-coercions'
//
- private boolean jsNoComplexImplicitCoercions = false;
+ private boolean jsComplexImplicitCoercions = true;
- public boolean getJsNoComplexImplicitCoercions()
+ public boolean getJsComplexImplicitCoercions()
{
- return jsNoComplexImplicitCoercions;
+ return jsComplexImplicitCoercions;
}
/**
- * Support for avoiding more complex implicit assignment coercions
+ * Support for including/avoiding more complex implicit assignment
coercions
* example
* var array:Array = [new MyClass()];
* var myOtherClass:MyOtherClass = array[0];
@@ -493,22 +493,22 @@ public class JSConfiguration extends Configuration
* in other compiler targets (for example, swf bytecode) if the same
source code is shared between targets.
*/
@Config(advanced = true)
- @Mapping("js-no-complex-implicit-coercions")
- public void setJsNoComplexImplicitCoercions(ConfigurationValue cv, boolean
value)
+ @Mapping("js-complex-implicit-coercions")
+ public void setJsComplexImplicitCoercions(ConfigurationValue cv, boolean
value)
throws ConfigurationException
{
- jsNoComplexImplicitCoercions = value;
+ jsComplexImplicitCoercions = value;
}
//
- // 'js-no-resolve-uncertain'
+ // 'js-resolve-uncertain'
//
- private boolean jsNoResolveUncertain = false;
+ private boolean jsResolveUncertain = true;
- public boolean getJsNoResolveUncertain()
+ public boolean getJsResolveUncertain()
{
- return jsNoResolveUncertain;
+ return jsResolveUncertain;
}
/**
@@ -531,22 +531,22 @@ public class JSConfiguration extends Configuration
* doc comment compiler directive.
*/
@Config(advanced = true)
- @Mapping("js-no-resolve-uncertain")
- public void setJsNoResolveUncertain(ConfigurationValue cv, boolean value)
+ @Mapping("js-resolve-uncertain")
+ public void setJsResolveUncertain(ConfigurationValue cv, boolean value)
throws ConfigurationException
{
- jsNoResolveUncertain = value;
+ jsResolveUncertain = value;
}
//
- // 'js-no-vector-index-checks'
+ // 'js-vector-index-checks'
//
- private boolean jsNoVectorIndexChecks = false;
+ private boolean jsVectorIndexChecks = true;
- public boolean getJsNoVectorIndexChecks()
+ public boolean getJsVectorIndexChecks()
{
- return jsNoVectorIndexChecks;
+ return jsVectorIndexChecks;
}
/**
@@ -571,11 +571,11 @@ public class JSConfiguration extends Configuration
* doc comment compiler directive.
*/
@Config(advanced = true)
- @Mapping("js-no-vector-index-checks")
- public void setJsNoVectorIndexChecks(ConfigurationValue cv, boolean value)
+ @Mapping("js-vector-index-checks")
+ public void setJsVectorIndexChecks(ConfigurationValue cv, boolean value)
throws ConfigurationException
{
- jsNoVectorIndexChecks = value;
+ jsVectorIndexChecks = value;
}
}
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/JSEmitter.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/JSEmitter.java
index 5457ed1..9bc2e0c 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/JSEmitter.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/JSEmitter.java
@@ -760,11 +760,7 @@ public class JSEmitter extends ASEmitter implements
IJSEmitter
//catch leftovers: remaining implicit coercion of loosely typed
assigned values to strongly typed context
//assignment to Class definitions is excluded because there is no
'Class' type in JS
//Possibility: 'Class' could be implemented as a synthType
- boolean needsCoercion = true;
-
- if
(((RoyaleJSProject)project).config.getJsNoComplexImplicitCoercions()) {
- needsCoercion = false;
- }
+ boolean needsCoercion =
((RoyaleJSProject)project).config.getJsComplexImplicitCoercions();
IDocEmitter docEmitter = getDocEmitter();
if (docEmitter instanceof JSRoyaleDocEmitter)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
index 9c65d4f..5b78317 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
@@ -113,11 +113,8 @@ public class DynamicAccessEmitter extends JSSubEmitter
implements
if
(node.getNodeID().equals(ASTNodeID.ArrayIndexExpressionID)){
if (node.getParent() instanceof
BinaryOperatorAssignmentNode) {
if
(node.getLeftOperandNode().resolveType(getProject()) instanceof
AppliedVectorDefinition) {
- boolean
suppressVectorIndexCheck = false;
- if
(((RoyaleJSProject)getProject()).config.getJsNoVectorIndexChecks()) {
- //wrapVectorIndex =
false;
-
suppressVectorIndexCheck = true;
- }
+ boolean
suppressVectorIndexCheck =
!(((RoyaleJSProject)getProject()).config.getJsVectorIndexChecks());
+
IDocEmitter docEmitter =
getEmitter().getDocEmitter();
if (docEmitter instanceof
JSRoyaleDocEmitter)
{
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
index bb4be2b..9426b1b 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
@@ -502,13 +502,10 @@ public class FunctionCallEmitter extends JSSubEmitter
implements ISubEmitter<IFu
private boolean shouldResolveUncertain(IExpressionNode nameNode, boolean
forceExplicit) {
//default if not avoided globally
- boolean should = true;
+ boolean should =
((RoyaleJSProject)getProject()).config.getJsResolveUncertain();
//just in case:
if (!(getProject() instanceof RoyaleJSProject)) return false;
- if (((RoyaleJSProject)getProject()).config.getJsNoResolveUncertain()) {
- //start with global toggle
- should = false;
- }
+
IDocEmitter docEmitter = getEmitter().getDocEmitter();
if (docEmitter instanceof JSRoyaleDocEmitter)
{