File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed
src/main/java/org/truffleruby/parser Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Compatibility:
11
11
12
12
Performance:
13
13
14
+ * Replace a call of ` -"string" ` with frozen string literal at parse time (@andrykonchin ).
14
15
15
16
Changes:
16
17
Original file line number Diff line number Diff line change @@ -509,7 +509,8 @@ public RubyNode visitCallNode(CallParseNode node) {
509
509
final ParseNode receiver = node .getReceiverNode ();
510
510
final String methodName = node .getName ();
511
511
512
- if (receiver instanceof StrParseNode && methodName .equals ("freeze" )) {
512
+ if (receiver instanceof StrParseNode &&
513
+ (methodName .equals ("freeze" ) || methodName .equals ("-@" ))) {
513
514
final StrParseNode strNode = (StrParseNode ) receiver ;
514
515
final Rope nodeRope = strNode .getValue ();
515
516
final ImmutableRubyString frozenString = language
Original file line number Diff line number Diff line change 3
3
exclude :test_hash_aref_with , "needs investigation"
4
4
exclude :test_nil_safe_conditional_assign , "needs investigation"
5
5
exclude :test_optimized_rescue , "needs investigation"
6
- exclude :test_string_freeze , "needs investigation"
6
+ exclude :test_string_freeze , "TruffleRuby does not consider redefined String#freeze on string literals for simplicity"
7
+ exclude :test_string_uminus , "TruffleRuby does not consider redefined String#-@ on string literals for simplicity"
7
8
exclude :test_string_freeze_block , "needs investigation"
8
9
exclude :test_string_freeze_saves_memory , "needs investigation"
9
10
exclude :test_string_length , "needs investigation"
You can’t perform that action at this time.
0 commit comments