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

Issue 10689036: First step towards having patch files for generic libraries. (Closed)

Created:
8 years, 5 months ago by Lasse Reichstein Nielsen
Modified:
8 years, 5 months ago
CC:
reviews_dartlang.org, ahe
Visibility:
Public.

Description

First step towards having patch files for generic libraries. As proof of concept, it patches a non-functional htmlEscape from web.dart. Still has lots of restrictions: - Only loads a normal library (no syntax extension to mark patches as separate from additions). Assumes every element is a patch. - Only handles top-level functions (probably won't handle getters/setters or constructors), and not classes. - Doesn't check that the patched function is marked external (no syntax for that in the spec yet, doesn't even require it to be abstract). - Doesn't check that the signature of the patch function matches the original function. - Probably won't work for 'coreimpl', as loaded from 'js_helper', since it's not loaded using the 'dart:' scheme. Committed: https://code.google.com/p/dart/source/detail?r=9246

Patch Set 1 #

Total comments: 13

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+194 lines, -35 lines) Patch
M lib/compiler/implementation/apiimpl.dart View 3 chunks +8 lines, -2 lines 0 comments Download
M lib/compiler/implementation/compiler.dart View 1 1 chunk +68 lines, -0 lines 0 comments Download
M lib/compiler/implementation/elements/elements.dart View 1 7 chunks +47 lines, -9 lines 0 comments Download
A + lib/compiler/implementation/lib/web.dart View 1 chunk +3 lines, -3 lines 0 comments Download
A + lib/compiler/implementation/lib/web.dartp View 1 chunk +8 lines, -2 lines 0 comments Download
M lib/compiler/implementation/library_map.dart View 1 chunk +38 lines, -14 lines 0 comments Download
M lib/compiler/implementation/scanner/listener.dart View 2 chunks +8 lines, -1 line 0 comments Download
M lib/compiler/implementation/scanner/scanner_task.dart View 1 chunk +5 lines, -1 line 0 comments Download
M lib/compiler/implementation/source_file.dart View 1 chunk +2 lines, -1 line 0 comments Download
M lib/compiler/implementation/source_map_builder.dart View 2 chunks +4 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Lasse Reichstein Nielsen
8 years, 5 months ago (2012-06-29 08:39:32 UTC) #1
Johnni Winther
https://chromiumcodereview.appspot.com/10689036/diff/1/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10689036/diff/1/lib/compiler/implementation/elements/elements.dart#newcode207 lib/compiler/implementation/elements/elements.dart:207: String toString() { Thank you! https://chromiumcodereview.appspot.com/10689036/diff/1/lib/compiler/implementation/elements/elements.dart#newcode637 lib/compiler/implementation/elements/elements.dart:637: if (cachedNode ...
8 years, 5 months ago (2012-06-29 09:34:43 UTC) #2
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/10689036/diff/1/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10689036/diff/1/lib/compiler/implementation/elements/elements.dart#newcode637 lib/compiler/implementation/elements/elements.dart:637: if (cachedNode !== null) throw "Patch After Parsing"; It ...
8 years, 5 months ago (2012-06-29 12:01:35 UTC) #3
Johnni Winther
lgtm
8 years, 5 months ago (2012-06-29 12:09:04 UTC) #4
floitsch
LGTM. Any thoughts on testing that the patching is done? https://chromiumcodereview.appspot.com/10689036/diff/1/tests/compiler/dart2js/mock_compiler.dart File tests/compiler/dart2js/mock_compiler.dart (right): https://chromiumcodereview.appspot.com/10689036/diff/1/tests/compiler/dart2js/mock_compiler.dart#newcode159 ...
8 years, 5 months ago (2012-06-29 12:11:51 UTC) #5
Lasse Reichstein Nielsen
8 years, 5 months ago (2012-06-29 12:19:35 UTC) #6
> Any thoughts on testing that the patching is done?

For now I've just run a manual test. The web-library is just a test case, it
doesn't need patching. When we get to the real libraries, and start making
important methods do nothing, simply running correctly will be proof of
patching.

https://chromiumcodereview.appspot.com/10689036/diff/1/tests/compiler/dart2js...
File tests/compiler/dart2js/mock_compiler.dart (right):

https://chromiumcodereview.appspot.com/10689036/diff/1/tests/compiler/dart2js...
tests/compiler/dart2js/mock_compiler.dart:159: // The mock library don't need
any patches.
On 2012/06/29 12:11:51, floitsch wrote:
> doesn't

Done.

Powered by Google App Engine
This is Rietveld 408576698