1.1 --- a/ko/archetype/src/main/resources/archetype-resources/pom.xml Mon Sep 23 00:59:14 2013 +0200
1.2 +++ b/ko/archetype/src/main/resources/archetype-resources/pom.xml Sat Sep 28 01:23:06 2013 +0200
1.3 @@ -205,21 +205,6 @@
1.4 <build>
1.5 <plugins>
1.6 <plugin>
1.7 - <groupId>org.apidesign.bck2brwsr</groupId>
1.8 - <artifactId>bck2brwsr-maven-plugin</artifactId>
1.9 - <executions>
1.10 - <execution>
1.11 - <goals>
1.12 - <goal>j2js</goal>
1.13 - </goals>
1.14 - </execution>
1.15 - </executions>
1.16 - <configuration>
1.17 - <javascript>\${project.build.directory}/bck2brwsr.js</javascript>
1.18 - <obfuscation>\${bck2brwsr.obfuscationlevel}</obfuscation>
1.19 - </configuration>
1.20 - </plugin>
1.21 - <plugin>
1.22 <groupId>org.apache.maven.plugins</groupId>
1.23 <artifactId>maven-compiler-plugin</artifactId>
1.24 <configuration>
1.25 @@ -261,6 +246,14 @@
1.26 <version>\${bck2brwsr.version}</version>
1.27 <scope>runtime</scope>
1.28 </dependency>
1.29 + <dependency>
1.30 + <groupId>org.apidesign.bck2brwsr</groupId>
1.31 + <artifactId>vm4brwsr</artifactId>
1.32 + <classifier>js</classifier>
1.33 + <type>zip</type>
1.34 + <version>\${bck2brwsr.version}</version>
1.35 + <scope>provided</scope>
1.36 + </dependency>
1.37 </dependencies>
1.38 </profile>
1.39 </profiles>
2.1 --- a/ko/archetype/src/main/resources/archetype-resources/src/main/assembly/bck2brwsr.xml Mon Sep 23 00:59:14 2013 +0200
2.2 +++ b/ko/archetype/src/main/resources/archetype-resources/src/main/assembly/bck2brwsr.xml Sat Sep 28 01:23:06 2013 +0200
2.3 @@ -17,6 +17,15 @@
2.4 <include>*:rt</include>
2.5 </includes>
2.6 </dependencySet>
2.7 + <dependencySet>
2.8 + <useProjectArtifact>false</useProjectArtifact>
2.9 + <scope>provided</scope>
2.10 + <includes>
2.11 + <include>*:js</include>
2.12 + </includes>
2.13 + <unpack>true</unpack>
2.14 + <outputDirectory>/</outputDirectory>
2.15 + </dependencySet>
2.16 </dependencySets>
2.17 <fileSets>
2.18 <fileSet>
2.19 @@ -40,9 +49,5 @@
2.20 <source>${project.build.directory}/${project.build.finalName}.jar</source>
2.21 <outputDirectory>/</outputDirectory>
2.22 </file>
2.23 - <file>
2.24 - <source>${project.build.directory}/bck2brwsr.js</source>
2.25 - <outputDirectory>/</outputDirectory>
2.26 - </file>
2.27 </files>
2.28 </assembly>
2.29 \ No newline at end of file
3.1 --- a/ko/archetype/src/main/resources/archetype-resources/src/main/webapp/pages/index.html Mon Sep 23 00:59:14 2013 +0200
3.2 +++ b/ko/archetype/src/main/resources/archetype-resources/src/main/webapp/pages/index.html Sat Sep 28 01:23:06 2013 +0200
3.3 @@ -9,12 +9,21 @@
3.4 0% { -webkit-transform: rotate(0deg); }
3.5 100% { -webkit-transform: rotate(360deg); }
3.6 }
3.7 + @keyframes spin {
3.8 + 0% { transform: rotate(0deg); }
3.9 + 100% { transform: rotate(360deg); }
3.10 + }
3.11
3.12 .rotate {
3.13 -webkit-animation-name: spin;
3.14 -webkit-animation-duration: 3s;
3.15 -webkit-animation-iteration-count: infinite;
3.16 -webkit-animation-direction: alternate;
3.17 +
3.18 + animation-name: spin;
3.19 + animation-duration: 3s;
3.20 + animation-iteration-count: infinite;
3.21 + animation-direction: alternate;
3.22 }
3.23
3.24 #scene {
4.1 --- a/rt/emul/compact/src/test/java/org/apidesign/bck2brwsr/tck/EnumsTest.java Mon Sep 23 00:59:14 2013 +0200
4.2 +++ b/rt/emul/compact/src/test/java/org/apidesign/bck2brwsr/tck/EnumsTest.java Sat Sep 28 01:23:06 2013 +0200
4.3 @@ -1,3 +1,20 @@
4.4 +/**
4.5 + * Back 2 Browser Bytecode Translator
4.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
4.7 + *
4.8 + * This program is free software: you can redistribute it and/or modify
4.9 + * it under the terms of the GNU General Public License as published by
4.10 + * the Free Software Foundation, version 2 of the License.
4.11 + *
4.12 + * This program is distributed in the hope that it will be useful,
4.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4.15 + * GNU General Public License for more details.
4.16 + *
4.17 + * You should have received a copy of the GNU General Public License
4.18 + * along with this program. Look for COPYING file in the top folder.
4.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
4.20 + */
4.21 package org.apidesign.bck2brwsr.tck;
4.22
4.23 import java.util.EnumMap;
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/rt/emul/compact/src/test/java/org/apidesign/bck2brwsr/tck/RegExpReplaceAllTest.java Sat Sep 28 01:23:06 2013 +0200
5.3 @@ -0,0 +1,54 @@
5.4 +/**
5.5 + * Back 2 Browser Bytecode Translator
5.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
5.7 + *
5.8 + * This program is free software: you can redistribute it and/or modify
5.9 + * it under the terms of the GNU General Public License as published by
5.10 + * the Free Software Foundation, version 2 of the License.
5.11 + *
5.12 + * This program is distributed in the hope that it will be useful,
5.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5.15 + * GNU General Public License for more details.
5.16 + *
5.17 + * You should have received a copy of the GNU General Public License
5.18 + * along with this program. Look for COPYING file in the top folder.
5.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
5.20 + */
5.21 +package org.apidesign.bck2brwsr.tck;
5.22 +
5.23 +import org.apidesign.bck2brwsr.vmtest.Compare;
5.24 +import org.apidesign.bck2brwsr.vmtest.VMTest;
5.25 +import org.testng.annotations.Factory;
5.26 +
5.27 +/**
5.28 + *
5.29 + * @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
5.30 + */
5.31 +public class RegExpReplaceAllTest {
5.32 +
5.33 + @Compare public String replaceAll() {
5.34 + return "JavaScript".replaceAll("Script", "One");
5.35 + }
5.36 +
5.37 + @Compare public String replaceAllTwice() {
5.38 + return "Script JavaScript!".replaceAll("Script", "One");
5.39 + }
5.40 +
5.41 +
5.42 + @Compare public String replaceAllRegexp() {
5.43 + return "JavaScript".replaceAll("S....t", "One");
5.44 + }
5.45 +
5.46 + @Compare public String replaceAllRegexpTwice() {
5.47 + return "Script JavaScript!".replaceAll("S....t", "One");
5.48 + }
5.49 +
5.50 + @Compare public String replaceFirstRegexpOnly() {
5.51 + return "Script JavaScript!".replaceFirst("S....t", "One");
5.52 + }
5.53 +
5.54 + @Factory public static Object[] create() {
5.55 + return VMTest.create(RegExpReplaceAllTest.class);
5.56 + }
5.57 +}
6.1 --- a/rt/emul/mini/src/main/java/java/lang/String.java Mon Sep 23 00:59:14 2013 +0200
6.2 +++ b/rt/emul/mini/src/main/java/java/lang/String.java Sat Sep 28 01:23:06 2013 +0200
6.3 @@ -2159,6 +2159,14 @@
6.4 * @since 1.4
6.5 * @spec JSR-51
6.6 */
6.7 + @JavaScriptBody(args = { "regex", "newText" }, body =
6.8 + "var self = this.toString();\n"
6.9 + + "var re = new RegExp(regex.toString());\n"
6.10 + + "var r = re.exec(self);\n"
6.11 + + "if (r === null || r.length === 0) return this;\n"
6.12 + + "var from = self.indexOf(r[0]);\n"
6.13 + + "return this.substring(0, from) + newText + this.substring(from + r[0].length);\n"
6.14 + )
6.15 public String replaceFirst(String regex, String replacement) {
6.16 throw new UnsupportedOperationException();
6.17 }
6.18 @@ -2203,7 +2211,14 @@
6.19 * @spec JSR-51
6.20 */
6.21 public String replaceAll(String regex, String replacement) {
6.22 - throw new UnsupportedOperationException();
6.23 + String p = this;
6.24 + for (;;) {
6.25 + String n = p.replaceFirst(regex, replacement);
6.26 + if (n == p) {
6.27 + return n;
6.28 + }
6.29 + p = n;
6.30 + }
6.31 }
6.32
6.33 /**