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

Issue 2982843002: [fasta] Create a 'constant helper' class which will throw on illegal 'constant' expressions (Closed)

Created:
3 years, 5 months ago by jensj
Modified:
3 years, 4 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[fasta] Create a 'constant helper' class which will throw on illegal 'constant' expressions Currently kernel fails a number of test because too much is allowed to be constant. Examples includes const x = "hello " * 4; // yielding "hello hello hello hello " const y = "hello".leng; // crashing the VM The idea behing the helper class is, that fasta can generate those as for instance var c = new _ConstantHelper(); const x = c.times("hello ", 4, () => thow yadayada); where - upon evaluating it in for instance the VMs constant evaluator - the helper will see that "hello " is neiher an integer nor null, and thus execute the given onError function. This is only one step towards that; it will still have to be hooked up in fasta, and constant evaluators (e.g. in the VM, I suppose there's also one in dart2js etc) might need to be updated to be able to execute it. R=ahe@google.com Committed: https://github.com/dart-lang/sdk/commit/73a54a30d566cb5eaa0b0e1ed12f3b770c91c97f

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -0 lines) Patch
M sdk/lib/core/errors.dart View 1 chunk +187 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
jensj
Based on idea from Peter. PTAL. (It should be noted that I'm going on vacation ...
3 years, 5 months ago (2017-07-14 13:34:39 UTC) #3
ahe
LGTM, this should be safe to land before going on vacation.
3 years, 5 months ago (2017-07-14 13:46:36 UTC) #4
jensj
Committed patchset #1 (id:1) manually as 73a54a30d566cb5eaa0b0e1ed12f3b770c91c97f (presubmit successful).
3 years, 4 months ago (2017-08-03 06:38:36 UTC) #6
jensj
3 years, 4 months ago (2017-08-03 06:49:56 UTC) #7
Message was sent while issue was closed.
On 2017/07/14 13:46:36, ahe wrote:
> LGTM, this should be safe to land before going on vacation.

Landed now. I had already left when you wrote the above :)

Powered by Google App Engine
This is Rietveld 408576698