| Index: pkg/analyzer/lib/src/summary/resynthesize.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
|
| index 107d34f603b928c7c5d549306874ca303e2920ac..205628f5fdb8cb4f9f3c385e1f62ba88dcff5258 100644
|
| --- a/pkg/analyzer/lib/src/summary/resynthesize.dart
|
| +++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
|
| @@ -426,8 +426,12 @@ class _ConstExprBuilder {
|
| _pushInstanceCreation();
|
| break;
|
| case UnlinkedConstOperation.length:
|
| - return AstFactory.nullLiteral();
|
| -// throw new StateError('Unsupported constant operation $operation');
|
| + Expression target = _pop();
|
| + SimpleIdentifier property = AstFactory.identifier3('length');
|
| + property.staticElement =
|
| + resynthesizer._buildStringLengthPropertyAccessorElement();
|
| + _push(AstFactory.propertyAccess(target, property));
|
| + break;
|
| }
|
| }
|
| return stack.single;
|
| @@ -1621,6 +1625,9 @@ class _LibraryResynthesizer {
|
| assert(location.components.length == 4);
|
| element = new MethodElementHandle(summaryResynthesizer, location);
|
| break;
|
| + case ReferenceKind.length:
|
| + element = _buildStringLengthPropertyAccessorElement();
|
| + break;
|
| default:
|
| // This is an element that doesn't (yet) need to be referred to
|
| // directly, so don't bother populating an element for it.
|
| @@ -1689,6 +1696,15 @@ class _LibraryResynthesizer {
|
| }
|
|
|
| /**
|
| + * Return the new handle of the `String.length` getter element.
|
| + */
|
| + PropertyAccessorElementHandle _buildStringLengthPropertyAccessorElement() =>
|
| + new PropertyAccessorElementHandle(
|
| + summaryResynthesizer,
|
| + new ElementLocationImpl.con3(
|
| + <String>['dart:core', 'dart:core', 'String', 'length?']));
|
| +
|
| + /**
|
| * If the given [kind] is a top-level or class member property accessor, and
|
| * the given [name] does not end with `=`, i.e. does not denote a setter,
|
| * return the getter identifier by appending `?`.
|
|
|