Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Issue 9960084: Introduce a flag to disable string operator + (Closed)

Created:
8 years, 8 months ago by hausner
Modified:
8 years, 8 months ago
Reviewers:
srdjan, Ivan Posva
CC:
reviews_dartlang.org, dgrove, Anton Muhin, ahe
Visibility:
Public.

Description

Introduce a flag to disable string operator + If allow_string_plus is set to false, the compiler will report an error when it finds a string literal followed by +. Invoking the + operator on a string value throws a noSuchMethod exception. This is temporary code that we'll eliminate once the + operator on strings is completely removed. Committed: https://code.google.com/p/dart/source/detail?r=6423

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -3 lines) Patch
M runtime/lib/string.cc View 1 1 chunk +21 lines, -0 lines 0 comments Download
M runtime/lib/string.dart View 1 1 chunk +7 lines, -1 line 2 comments Download
M runtime/vm/bootstrap_natives.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 chunks +7 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
hausner
8 years, 8 months ago (2012-04-10 23:43:36 UTC) #1
Ivan Posva
LGTM -ip https://chromiumcodereview.appspot.com/9960084/diff/1/runtime/lib/string.cc File runtime/lib/string.cc (right): https://chromiumcodereview.appspot.com/9960084/diff/1/runtime/lib/string.cc#newcode121 runtime/lib/string.cc:121: DECLARE_FLAG(bool, allow_string_plus); Usually we try to declare ...
8 years, 8 months ago (2012-04-11 12:03:56 UTC) #2
srdjan
DBC https://chromiumcodereview.appspot.com/9960084/diff/5001/runtime/lib/string.dart File runtime/lib/string.dart (right): https://chromiumcodereview.appspot.com/9960084/diff/5001/runtime/lib/string.dart#newcode238 runtime/lib/string.dart:238: String plus(String other) native "String_plus"; Why not making ...
8 years, 8 months ago (2012-04-11 18:32:03 UTC) #3
hausner
8 years, 8 months ago (2012-04-11 18:36:22 UTC) #4
https://chromiumcodereview.appspot.com/9960084/diff/5001/runtime/lib/string.dart
File runtime/lib/string.dart (right):

https://chromiumcodereview.appspot.com/9960084/diff/5001/runtime/lib/string.d...
runtime/lib/string.dart:238: String plus(String other) native "String_plus";
On 2012/04/11 18:32:03, srdjan wrote:
> Why not making it private (_plus)?

Yes, would have been a good idea. But this code goes away in short time, so I
would not worry about it. Also, it's not exposed through the interface.

Powered by Google App Engine
This is Rietveld 408576698