77483ae5d3
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
Review URL: https://codereview.chromium.org/1436263002 .