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

Issue 1436263002: dart2js: Forbid # placeholders in JS function bodies. (Closed)

Created:
5 years, 1 month ago by sra1
Modified:
5 years ago
CC:
reviews_dartlang.org, asgerf
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

dart2js: Forbid # placeholders in JS function bodies. This enforces one of the guidelines that is described in the documentation for 'JS' in js_runtime/lib/foreign_helper.dart The JS code should be rewritten to explicitly capture the values in JS. // Dart 'a' might change after it is closed over. JS('', 'function(){return #;}', a); --> // Immediately bind Dart 'a' to JS 'a' and then close over JS 'a': // JS('', '(function(a){return function(){return a;};})(#)', a); R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/77483ae5d34ed0c90355718f515d744f545c0181

Patch Set 1 : #

Total comments: 2

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -65 lines) Patch
M pkg/compiler/lib/src/diagnostics/messages.dart View 1 2 chunks +9 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/native/js.dart View 1 chunk +29 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 1 1 chunk +4 lines, -0 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/async_patch.dart View 2 chunks +41 lines, -32 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_helper.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_mirrors.dart View 1 chunk +19 lines, -13 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_names.dart View 1 chunk +11 lines, -6 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/regexp_helper.dart View 1 chunk +12 lines, -11 lines 0 comments Download

Messages

Total messages: 12 (7 generated)
sra1
5 years, 1 month ago (2015-11-12 20:59:46 UTC) #8
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/1436263002/diff/40001/pkg/compiler/lib/src/ssa/builder.dart File pkg/compiler/lib/src/ssa/builder.dart (right): https://codereview.chromium.org/1436263002/diff/40001/pkg/compiler/lib/src/ssa/builder.dart#newcode4161 pkg/compiler/lib/src/ssa/builder.dart:4161: 'JS code must not use `#` inside functions'}); ...
5 years, 1 month ago (2015-11-12 21:21:29 UTC) #9
sra1
https://codereview.chromium.org/1436263002/diff/40001/pkg/compiler/lib/src/ssa/builder.dart File pkg/compiler/lib/src/ssa/builder.dart (right): https://codereview.chromium.org/1436263002/diff/40001/pkg/compiler/lib/src/ssa/builder.dart#newcode4161 pkg/compiler/lib/src/ssa/builder.dart:4161: 'JS code must not use `#` inside functions'}); On ...
5 years, 1 month ago (2015-11-12 22:23:26 UTC) #10
Siggi Cherem (dart-lang)
On 2015/11/12 22:23:26, sra1 wrote: > https://codereview.chromium.org/1436263002/diff/40001/pkg/compiler/lib/src/ssa/builder.dart > File pkg/compiler/lib/src/ssa/builder.dart (right): > > https://codereview.chromium.org/1436263002/diff/40001/pkg/compiler/lib/src/ssa/builder.dart#newcode4161 > ...
5 years, 1 month ago (2015-11-12 22:29:47 UTC) #11
sra1
5 years, 1 month ago (2015-11-12 23:38:23 UTC) #12
Message was sent while issue was closed.
Committed patchset #2 (id:60001) manually as
77483ae5d34ed0c90355718f515d744f545c0181 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698