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

Side by Side Diff: pkg/polymer_expressions/test/eval_test.dart

Issue 24031006: Silently handle handle eval exceptions in PolymerExpressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library eval_test; 5 library eval_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:polymer_expressions/eval.dart'; 9 import 'package:polymer_expressions/eval.dart';
10 import 'package:polymer_expressions/filter.dart'; 10 import 'package:polymer_expressions/filter.dart';
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 matcher, 364 matcher,
365 reason: s); 365 reason: s);
366 366
367 expectObserve(String s, { 367 expectObserve(String s, {
368 Object model, 368 Object model,
369 Map variables: const {}, 369 Map variables: const {},
370 dynamic beforeMatcher, 370 dynamic beforeMatcher,
371 mutate(), 371 mutate(),
372 dynamic afterMatcher}) { 372 dynamic afterMatcher}) {
373 373
374 var observer = observe(new Parser(s).parse(), 374 var scope = new Scope(model: model, variables: variables);
375 new Scope(model: model, variables: variables)); 375 var observer = observe(new Parser(s).parse(), scope);
376 update(observer, scope);
376 expect(observer.currentValue, beforeMatcher); 377 expect(observer.currentValue, beforeMatcher);
377 var passed = false; 378 var passed = false;
378 var future = observer.onUpdate.first.then((value) { 379 var future = observer.onUpdate.first.then((value) {
379 expect(value, afterMatcher); 380 expect(value, afterMatcher);
380 expect(observer.currentValue, afterMatcher); 381 expect(observer.currentValue, afterMatcher);
381 passed = true; 382 passed = true;
382 }); 383 });
383 mutate(); 384 mutate();
384 // fail if we don't receive an update by the next event loop 385 // fail if we don't receive an update by the next event loop
385 return Future.wait([future, new Future(() { 386 return Future.wait([future, new Future(() {
386 expect(passed, true, reason: "Didn't receive a change notification on $s"); 387 expect(passed, true, reason: "Didn't receive a change notification on $s");
387 })]); 388 })]);
388 } 389 }
OLDNEW
« no previous file with comments | « pkg/polymer_expressions/lib/polymer_expressions.dart ('k') | pkg/polymer_expressions/test/syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698