Skip to content

Commit a7e4716

Browse files
committed
fixes and do not init NativeJavaObject and NativeJavaMap
1 parent 76c507a commit a7e4716

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@
386386
<token>compilerEnv.getLanguageVersion\(\) >= Context.VERSION_ES6</token>
387387
<value>/* HtmlUnit compilerEnv.getLanguageVersion\(\) >= #Context.VERSION_ES6 */ true</value>
388388
</replacement>
389+
<replacement>
390+
<token>parser.compilerEnv.getLanguageVersion\(\) &lt; Context.VERSION_ES6</token>
391+
<value>/* HtmlUnit parser.compilerEnv.getLanguageVersion\(\) &lt; #Context.VERSION_ES6 */ false</value>
392+
</replacement>
389393
<replacement>
390394
<token>compilerEnv.getLanguageVersion\(\) &lt; Context.VERSION_ES6</token>
391395
<value>/* HtmlUnit compilerEnv.getLanguageVersion\(\) &lt; #Context.VERSION_ES6 */ false</value>
@@ -396,7 +400,7 @@
396400
<value>/* HtmlUnit cx.hasFeature\(Context.FEATURE_OLD_UNDEF_NULL_THIS\) */ true</value>
397401
</replacement>
398402
<replacement>
399-
<token>cx.hasFeature\(Context.FEATURE_STRICT_MODE_\)</token>
403+
<token>cx.hasFeature\(Context.FEATURE_STRICT_MODE\)</token>
400404
<value>/* HtmlUnit cx.hasFeature\(Context.FEATURE_STRICT_MODE\) */ false</value>
401405
</replacement>
402406
<replacement>
@@ -416,6 +420,16 @@
416420
<value>/* HtmlUnit cx.hasFeature\(Context.FEATURE_INTL_402\) */ true</value>
417421
</replacement>
418422

423+
<replacement>
424+
<token>NativeJavaObject.init\(scope, sealed\);</token>
425+
<value>/* HtmlUnit NativeJavaObject.init\(scope, sealed\); */</value>
426+
</replacement>
427+
<replacement>
428+
<token>NativeJavaMap.init\(scope, sealed\);</token>
429+
<value>/* HtmlUnit NativeJavaMap.init\(scope, sealed\); */</value>
430+
</replacement>
431+
432+
419433
</replacements>
420434
</configuration>
421435
</execution>

src/test/java/org/htmlunit/corejs/ArgumentsTest.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ public void writableWithinFunction() throws Exception {
7878
+ "test1('hello', 'world');\n"
7979
+ "output";
8080

81-
runScript(script, "2-hi-undefined-you", Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, true);
82-
runScript(script, "2-hi-undefined-you", Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, false);
81+
// we do a hard coded replacement
82+
// runScript(script, "2-hi-undefined-you", Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, true);
83+
// runScript(script, "2-hi-undefined-you", Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, false);
84+
Utils.assertWithAllModes_ES6("2-hi-undefined-you", script);
8385
}
8486

8587
/**
@@ -102,8 +104,10 @@ public void readonlyWhenAccessThroughFunction() throws Exception {
102104
+ "test();\n"
103105
+ "output";
104106

105-
runScript(script, "2-world-undefined-undefined", Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, true);
106-
runScript(script, "2-hi-undefined-you", Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, false);
107+
// we do a hard coded replacement
108+
// runScript(script, "2-world-undefined-undefined", Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, true);
109+
// runScript(script, "2-hi-undefined-you", Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, false);
110+
Utils.assertWithAllModes_ES6("2-world-undefined-undefined", script);
107111
}
108112

109113
/**
@@ -116,8 +120,10 @@ public void equalsWithFnArguments() throws Exception {
116120
+ "}\n"
117121
+ "test1('hello', 'world')";
118122

119-
runScript(script, false, Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, true);
120-
runScript(script, true, Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, false);
123+
// we do a hard coded replacement
124+
// runScript(script, false, Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, true);
125+
// runScript(script, true, Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW, false);
126+
Utils.assertWithAllModes_ES6(false, script);
121127
}
122128

123129
private static void runScript(final String script, final Object expectedResult,

0 commit comments

Comments
 (0)