diff --git a/opal/clearwater/virtual_dom.rb b/opal/clearwater/virtual_dom.rb
index <HASH>..<HASH> 100644
--- a/opal/clearwater/virtual_dom.rb
+++ b/opal/clearwater/virtual_dom.rb
@@ -54,7 +54,11 @@ module VirtualDOM
 
   module StringUtils
     def self.camelize string
-      string.gsub(/_(\w)/) { |match| match.gsub(/_/, '').upcase }
+      %x{
+        return string.replace(/_(\w)/g, function(full_match, character_match) {
+          return character_match.toUpperCase();
+        })
+      }
     end
   end
Inline StringUtils.camlize to JS

The String#gsub method gets wrapped in a try/catch block by Opal, which
the VM can't optimize. Using the direct JS version also removes a lot of
the flexibility of the gsub method that we don't need, which is good
since it comes with a performance penalty, as well.