nashorn/test/examples/string-micro.js
author mkos
Thu, 07 Mar 2013 07:19:35 -0500
changeset 16895 2f7edbd000c4
parent 16192 a2f89e8f0b87
child 24720 75f8388b79df
permissions -rw-r--r--
8005432: Update access to JAX-WS Summary: newly restricted the whole package com.sun.xml.internal; fix reviewed also by Alexander Fomin Reviewed-by: mullan, skoivu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16192
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     1
/*
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     3
 * 
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     4
 * Redistribution and use in source and binary forms, with or without
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     5
 * modification, are permitted provided that the following conditions
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     6
 * are met:
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     7
 * 
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     8
 *   - Redistributions of source code must retain the above copyright
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
     9
 *     notice, this list of conditions and the following disclaimer.
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    10
 * 
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    11
 *   - Redistributions in binary form must reproduce the above copyright
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    12
 *     notice, this list of conditions and the following disclaimer in the
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    13
 *     documentation and/or other materials provided with the distribution.
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    14
 * 
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    15
 *   - Neither the name of Oracle nor the names of its
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    16
 *     contributors may be used to endorse or promote products derived
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    17
 *     from this software without specific prior written permission.
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    18
 * 
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    19
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    20
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    21
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    22
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    23
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    24
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    25
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    26
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    27
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    28
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    29
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    30
 */
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    31
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    32
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    33
var str = "The quick gray nashorn jumps over the lazy zebra.";
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    34
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    35
function bench(name, func) {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    36
    var start = Date.now();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    37
    for (var iter = 0; iter < 5000000; iter++) {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    38
        func();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    39
    }
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    40
    print((Date.now() - start) + "\t" + name);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    41
}
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    42
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    43
bench("[]", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    44
    str[0];
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    45
    str[1];
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    46
    str[2];
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    47
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    48
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    49
bench("fromCharCode", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    50
    String.fromCharCode(97);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    51
    String.fromCharCode(98);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    52
    String.fromCharCode(99);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    53
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    54
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    55
bench("charAt 1", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    56
    str.charAt(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    57
    str.charAt(1);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    58
    str.charAt(2);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    59
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    60
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    61
bench("charAt 2", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    62
    str.charAt(100);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    63
    str.charAt(-1);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    64
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    65
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    66
bench("charCodeAt 1", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    67
    str.charCodeAt(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    68
    str.charCodeAt(1);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    69
    str.charCodeAt(2);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    70
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    71
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    72
bench("charCodeAt 2", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    73
    str.charCodeAt(100);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    74
    str.charCodeAt(-1);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    75
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    76
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    77
bench("indexOf 1", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    78
    str.indexOf("T");
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    79
    str.indexOf("h");
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    80
    str.indexOf("e");
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    81
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    82
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    83
bench("indexOf 2", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    84
    str.indexOf("T", 0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    85
    str.indexOf("h", 1);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    86
    str.indexOf("e", 2);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    87
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    88
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    89
bench("lastIndexOf", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    90
    str.indexOf("a");
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    91
    str.indexOf("r");
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    92
    str.indexOf("b");
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    93
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    94
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    95
bench("slice", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    96
    str.slice(5);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    97
    str.slice(5);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    98
    str.slice(5);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
    99
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   100
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   101
bench("split 1", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   102
    str.split();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   103
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   104
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   105
bench("split 2", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   106
    str.split("foo");
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   107
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   108
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   109
bench("split 3", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   110
    str.split(/foo/);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   111
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   112
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   113
bench("substring 1", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   114
    str.substring(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   115
    str.substring(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   116
    str.substring(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   117
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   118
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   119
bench("substring 2", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   120
    str.substring(0, 5);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   121
    str.substring(0, 5);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   122
    str.substring(0, 5);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   123
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   124
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   125
bench("substr", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   126
    str.substr(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   127
    str.substr(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   128
    str.substr(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   129
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   130
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   131
bench("slice", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   132
    str.slice(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   133
    str.slice(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   134
    str.slice(0);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   135
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   136
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   137
bench("concat", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   138
    str.concat(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   139
    str.concat(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   140
    str.concat(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   141
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   142
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   143
bench("trim", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   144
    str.trim();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   145
    str.trim();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   146
    str.trim();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   147
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   148
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   149
bench("toUpperCase", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   150
    str.toUpperCase();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   151
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   152
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   153
bench("toLowerCase", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   154
    str.toLowerCase();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   155
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   156
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   157
bench("valueOf", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   158
    str.valueOf();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   159
    str.valueOf();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   160
    str.valueOf();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   161
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   162
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   163
bench("toString", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   164
    str.toString();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   165
    str.toString();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   166
    str.toString();
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   167
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   168
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   169
bench("String", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   170
    String(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   171
    String(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   172
    String(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   173
});
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   174
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   175
bench("new String", function() {
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   176
    new String(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   177
    new String(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   178
    new String(str);
a2f89e8f0b87 8006408: Clean up and specialize NativeString
hannesw
parents:
diff changeset
   179
});