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

Side by Side Diff: third_party/pkg/angular/playback_middleware/lib/playback.js

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
2 function playback(opts) {
3 var records = [];
4 var seen = {};
5
6 function record(key, data) {
7 if (seen[key]) return;
8 records.push({key: key, data: data});
9 seen[key] = true;
10 }
11
12 function playback() {
13 var lines = [
14 'library angular.core.service.playback_data;',
15 '',
16 'import "dart:convert";',
17 '',
18 '// Auto-generated by record-playback',
19 '',
20 'Map<String, String> playbackData = {'
21 ];
22
23 records.forEach(function(r) {
24 var keyString = JSON.stringify(r.key).replace(/\$/g, '\\$');
25 var valueString = JSON.stringify(r.data).replace(/\$/g, '\\$');
26 lines.push(' ' + keyString + ': JSON.decode(' + valueString + '),');
27 });
28
29 lines.push('};');
30
31 return lines.join('\n');
32 }
33
34 return {
35 record: record,
36 playback: playback
37 }
38 }
39
40 module.exports = {
41 playback: playback
42 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698