mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 02:27:58 +00:00
Revert "Switch libraries to using new tags."
Still errs in the editor. TBR=danrubel@google.com Review URL: https://codereview.chromium.org//11612020 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16257 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
310225aabf
commit
e33455dd1f
|
@ -6,7 +6,7 @@
|
|||
|
||||
{
|
||||
'sources': [
|
||||
'../../sdk/lib/mirrors/mirror_classes.dart',
|
||||
'../../sdk/lib/mirrors/mirrors.dart',
|
||||
'mirrors.cc',
|
||||
'mirrors.h',
|
||||
'mirrors_impl.dart',
|
||||
|
|
|
@ -6,7 +6,7 @@ library dart_mirrors;
|
|||
|
||||
import 'dart:isolate';
|
||||
|
||||
part '../../../../mirrors/mirror_classes.dart';
|
||||
part '../../../../mirrors/mirrors.dart';
|
||||
|
||||
/**
|
||||
* Stub class for the mirror system.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.collection;
|
||||
|
||||
// TODO(ngeoffray): Rename to Lists.
|
||||
class Arrays {
|
||||
static void copy(List src, int srcStart,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library dart.collection;
|
||||
library collection;
|
||||
|
||||
part 'arrays.dart';
|
||||
part 'collections.dart';
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.collection;
|
||||
|
||||
/**
|
||||
* The [Collections] class implements static methods useful when
|
||||
* writing a class that implements [Collection] and the [iterator]
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.collection;
|
||||
|
||||
/*
|
||||
* Helper class which implements complex [Map] operations
|
||||
* in term of basic ones ([Map.keys], [Map.operator []],
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.collection;
|
||||
|
||||
/**
|
||||
* A node in a splay tree. It holds the key, the value and the left
|
||||
* and right children in the tree.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
// Dart core library.
|
||||
|
||||
class bool {
|
||||
factory bool._uninstantiable() {
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* The common interface of all collections.
|
||||
*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
// Dart core library.
|
||||
|
||||
/**
|
||||
* The signature of a generic comparison function.
|
||||
|
|
|
@ -2,43 +2,43 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library dart.core;
|
||||
#library("dart:core");
|
||||
|
||||
import "dart:collection";
|
||||
#import("dart:collection");
|
||||
|
||||
part "bool.dart";
|
||||
part "collection.dart";
|
||||
part "comparable.dart";
|
||||
part "date.dart";
|
||||
part "double.dart";
|
||||
part "duration.dart";
|
||||
part "errors.dart";
|
||||
part "exceptions.dart";
|
||||
part "expando.dart";
|
||||
part "expect.dart";
|
||||
part "function.dart";
|
||||
part "future.dart";
|
||||
part "future_impl.dart";
|
||||
part "hashable.dart";
|
||||
part "identical.dart";
|
||||
part "int.dart";
|
||||
part "invocation_mirror.dart";
|
||||
part "iterable.dart";
|
||||
part "iterator.dart";
|
||||
part "list.dart";
|
||||
part "map.dart";
|
||||
part "num.dart";
|
||||
part "object.dart";
|
||||
part "options.dart";
|
||||
part "pattern.dart";
|
||||
part "print.dart";
|
||||
part "queue.dart";
|
||||
part "regexp.dart";
|
||||
part "sequences.dart";
|
||||
part "set.dart";
|
||||
part "sort.dart";
|
||||
part "stopwatch.dart";
|
||||
part "string.dart";
|
||||
part "string_buffer.dart";
|
||||
part "strings.dart";
|
||||
part "type.dart";
|
||||
#source("bool.dart");
|
||||
#source("collection.dart");
|
||||
#source("comparable.dart");
|
||||
#source("date.dart");
|
||||
#source("double.dart");
|
||||
#source("duration.dart");
|
||||
#source("errors.dart");
|
||||
#source("exceptions.dart");
|
||||
#source("expando.dart");
|
||||
#source("expect.dart");
|
||||
#source("function.dart");
|
||||
#source("future.dart");
|
||||
#source("future_impl.dart");
|
||||
#source("hashable.dart");
|
||||
#source("identical.dart");
|
||||
#source("int.dart");
|
||||
#source("invocation_mirror.dart");
|
||||
#source("iterable.dart");
|
||||
#source("iterator.dart");
|
||||
#source("list.dart");
|
||||
#source("map.dart");
|
||||
#source("num.dart");
|
||||
#source("object.dart");
|
||||
#source("options.dart");
|
||||
#source("pattern.dart");
|
||||
#source("print.dart");
|
||||
#source("queue.dart");
|
||||
#source("regexp.dart");
|
||||
#source("sequences.dart");
|
||||
#source("set.dart");
|
||||
#source("sort.dart");
|
||||
#source("stopwatch.dart");
|
||||
#source("string.dart");
|
||||
#source("string_buffer.dart");
|
||||
#source("strings.dart");
|
||||
#source("type.dart");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
// Dart core library.
|
||||
|
||||
/**
|
||||
* Date is the public interface to a point in time.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
// TODO: Convert this abstract class into a concrete class double
|
||||
// that uses the patch class functionality to account for the
|
||||
// different platform implementations.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
// Dart core library.
|
||||
|
||||
/**
|
||||
* A [Duration] represents a time span. A duration can be negative.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
class Error {
|
||||
const Error();
|
||||
|
||||
|
@ -77,7 +75,7 @@ class ArgumentError implements Error {
|
|||
}
|
||||
|
||||
/**
|
||||
* Error thrown because of an index outside of the valid range.
|
||||
* Exception thrown because of an index outside of the valid range.
|
||||
*
|
||||
*/
|
||||
class RangeError extends ArgumentError {
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
// Exceptions are thrown either by the VM or from Dart code.
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* An [Expando] allows adding new properties to objects.
|
||||
*/
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* Expect is used for tests that do not want to make use of the
|
||||
* Dart unit test library - for example, the core language tests.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
// Dart core library.
|
||||
|
||||
/**
|
||||
* Super-type of all function types.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* A [Future] is used to obtain a value sometime in the future. Receivers of a
|
||||
* [Future] can obtain the value by passing a callback to [then]. For example:
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright 2012 Google Inc. All Rights Reserved.
|
||||
// Dart core library.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
class _FutureImpl<T> implements Future<T> {
|
||||
|
||||
bool _isComplete = false;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
// Dart core library.
|
||||
|
||||
/**
|
||||
* Temporary interface for backwards compatibility.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* Check whether two references are to the same object.
|
||||
*/
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* Representation of Dart integers containing integer specific
|
||||
* operations and specialization of operations inherited from [num].
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* Representation of the invocation of a member on an object.
|
||||
*
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* The [Iterable] interface allows to get an [Iterator] out of an
|
||||
* [Iterable] object.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* The [Iterator] class provides methods to iterate over an object. It
|
||||
* is transparently used by the for-in construct to test for the end
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* A [List] is an indexable collection with a length. It can be of
|
||||
* fixed size or extendable.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* A [Map] is an associative container, mapping a key to a value.
|
||||
* Null values are supported, but null keys are not.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
// Dart core library.
|
||||
|
||||
/**
|
||||
* All numbers in dart are instances of [num].
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* Everything in Dart is an [Object].
|
||||
*/
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
// Dart core library.
|
||||
|
||||
/**
|
||||
* The Options object allows accessing the arguments which have been passed to
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
abstract class Pattern {
|
||||
Iterable<Match> allMatches(String str);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,4 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
external void print(Object object);
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* A [Queue] is a collection that can be manipulated at both ends. One
|
||||
* can iterate over the elements of a queue through [forEach] or with
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* [Match] contains methods to manipulate a regular expression match.
|
||||
*
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* An indexed sequence of elements of the same type.
|
||||
*
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* This class is the public interface of a set. A set is a collection
|
||||
* without duplicates.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
// TODO(ajohnsen): Remove once dart2js intercepters can work without it.
|
||||
/**
|
||||
* WARNING: This method is temporary and will go away soon.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* A simple [Stopwatch] interface to measure elapsed time.
|
||||
*/
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* The String class represents character strings. Strings are
|
||||
* immutable. A string is represented by a list of 32-bit Unicode
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* The StringBuffer class is useful for concatenating strings
|
||||
* efficiently. Only on a call to [toString] are the strings
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
abstract class Strings {
|
||||
/**
|
||||
* Joins all the given strings to create a new string.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.core;
|
||||
|
||||
/**
|
||||
* Runtime representation of a type.
|
||||
*/
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library dart.crypto;
|
||||
#library('dart:crypto');
|
||||
|
||||
import 'dart:math';
|
||||
#import('dart:math');
|
||||
|
||||
part 'crypto_utils.dart';
|
||||
part 'hash_utils.dart';
|
||||
part 'hmac.dart';
|
||||
part 'md5.dart';
|
||||
part 'sha1.dart';
|
||||
part 'sha256.dart';
|
||||
#source('crypto_utils.dart');
|
||||
#source('hash_utils.dart');
|
||||
#source('hmac.dart');
|
||||
#source('md5.dart');
|
||||
#source('sha1.dart');
|
||||
#source('sha256.dart');
|
||||
|
||||
/**
|
||||
* Interface for cryptographic hash functions.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.crypto;
|
||||
|
||||
class _LineWrappingStringBuffer {
|
||||
_LineWrappingStringBuffer(int this._lineLength) : _sb = new StringBuffer();
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.crypto;
|
||||
|
||||
// Constants.
|
||||
const _MASK_8 = 0xff;
|
||||
const _MASK_32 = 0xffffffff;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.crypto;
|
||||
|
||||
class _HMAC implements HMAC {
|
||||
_HMAC(Hash this._hash, List<int> this._key) : _message = [];
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.crypto;
|
||||
|
||||
// The MD5 hasher is used to compute an MD5 message digest.
|
||||
class _MD5 extends _HashBase implements MD5 {
|
||||
_MD5() : super(16, 4, false) {
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.crypto;
|
||||
|
||||
// The SHA1 hasher is used to compute an SHA1 message digest.
|
||||
class _SHA1 extends _HashBase implements SHA1 {
|
||||
// Construct a SHA1 hasher object.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.crypto;
|
||||
|
||||
// The SHA256 hasher is used to compute an SHA256 message digest.
|
||||
class _SHA256 extends _HashBase implements SHA256 {
|
||||
// Construct a SHA256 hasher object.
|
||||
|
|
|
@ -785,12 +785,54 @@ class CanvasElement extends Element native "*HTMLCanvasElement" {
|
|||
return e;
|
||||
}
|
||||
|
||||
/// The height of this canvas element in CSS pixels.
|
||||
/// @domName HTMLCanvasElement.height; @docsEditable true
|
||||
int height;
|
||||
|
||||
/// The width of this canvas element in CSS pixels.
|
||||
/// @domName HTMLCanvasElement.width; @docsEditable true
|
||||
int width;
|
||||
|
||||
/**
|
||||
* Returns a data URI containing a representation of the image in the
|
||||
* format specified by type (defaults to 'image/png').
|
||||
*
|
||||
* Data Uri format is as follow `data:[<MIME-type>][;charset=<encoding>][;base64],<data>`
|
||||
*
|
||||
* Optional parameter [quality] in the range of 0.0 and 1.0 can be used when requesting [type]
|
||||
* 'image/jpeg' or 'image/webp'. If [quality] is not passed the default
|
||||
* value is used. Note: the default value varies by browser.
|
||||
*
|
||||
* If the height or width of this canvas element is 0, then 'data:' is returned,
|
||||
* representing no data.
|
||||
*
|
||||
* If the type requested is not 'image/png', and the returned value is
|
||||
* 'data:image/png', then the requested type is not supported.
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
* CanvasElement canvas = new CanvasElement();
|
||||
* var ctx = canvas.context2d
|
||||
* ..fillStyle = "rgb(200,0,0)"
|
||||
* ..fillRect(10, 10, 55, 50);
|
||||
* var dataUrl = canvas.toDataURL("image/jpeg", 0.95);
|
||||
* // The Data Uri would look similar to
|
||||
* // 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
|
||||
* // AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
|
||||
* // 9TXL0Y4OHwAAAABJRU5ErkJggg=='
|
||||
* //Create a new image element from the data URI.
|
||||
* var img = new ImageElement();
|
||||
* img.src = dataUrl;
|
||||
* document.body.children.add(img);
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* * [Data URI Scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) from Wikipedia.
|
||||
*
|
||||
* * [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/DOM/HTMLCanvasElement) from MDN.
|
||||
*
|
||||
* * [toDataUrl](http://dev.w3.org/html5/spec/the-canvas-element.html#dom-canvas-todataurl) from W3C.
|
||||
*/
|
||||
/// @domName HTMLCanvasElement.toDataURL; @docsEditable true
|
||||
@JSName('toDataURL')
|
||||
String toDataUrl(String type, [num quality]) native;
|
||||
|
@ -804,9 +846,47 @@ class CanvasElement extends Element native "*HTMLCanvasElement" {
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
/**
|
||||
* An opaque canvas object representing a gradient.
|
||||
*
|
||||
* Created by calling [createLinearGradient] or [createRadialGradient] on a
|
||||
* [CanvasRenderingContext2D] object.
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
* var canvas = new CanvasElement(width: 600, height: 600);
|
||||
* var ctx = canvas.context2d;
|
||||
* ctx.clearRect(0, 0, 600, 600);
|
||||
* ctx.save();
|
||||
* // Create radial gradient.
|
||||
* CanvasGradient gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, 600);
|
||||
* gradient.addColorStop(0, '#000');
|
||||
* gradient.addColorStop(1, 'rgb(255, 255, 255)');
|
||||
* // Assign gradients to fill.
|
||||
* ctx.fillStyle = gradient;
|
||||
* // Draw a rectangle with a gradient fill.
|
||||
* ctx.fillRect(0, 0, 600, 600);
|
||||
* ctx.save();
|
||||
* document.body.children.add(canvas);
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* * [CanvasGradient](https://developer.mozilla.org/en-US/docs/DOM/CanvasGradient) from MDN.
|
||||
* * [CanvasGradient](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasgradient) from whatwg.
|
||||
* * [CanvasGradient](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvasgradient) from W3C.
|
||||
*/
|
||||
/// @domName CanvasGradient; @docsEditable true
|
||||
class CanvasGradient native "*CanvasGradient" {
|
||||
|
||||
/**
|
||||
* Adds a color stop to this gradient at the offset.
|
||||
*
|
||||
* The [offset] can range between 0.0 and 1.0.
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* * [Multiple Color Stops](https://developer.mozilla.org/en-US/docs/CSS/linear-gradient#Gradient_with_multiple_color_stops) from MDN.
|
||||
*/
|
||||
/// @domName CanvasGradient.addColorStop; @docsEditable true
|
||||
void addColorStop(num offset, String color) native;
|
||||
}
|
||||
|
@ -815,6 +895,33 @@ class CanvasGradient native "*CanvasGradient" {
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
/**
|
||||
* An opaque object representing a pattern of image, canvas, or video.
|
||||
*
|
||||
* Created by calling [createPattern] on a [CanvasRenderingContext2D] object.
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
* var canvas = new CanvasElement(width: 600, height: 600);
|
||||
* var ctx = canvas.context2d;
|
||||
* var img = new ImageElement();
|
||||
* // Image src needs to be loaded before pattern is applied.
|
||||
* img.on.load.add((event) {
|
||||
* // When the image is loaded, create a pattern
|
||||
* // from the ImageElement.
|
||||
* CanvasPattern pattern = ctx.createPattern(img, 'repeat');
|
||||
* ctx.rect(0, 0, canvas.width, canvas.height);
|
||||
* ctx.fillStyle = pattern;
|
||||
* ctx.fill();
|
||||
* });
|
||||
* img.src = "images/foo.jpg";
|
||||
* document.body.children.add(canvas);
|
||||
*
|
||||
* See also:
|
||||
* * [CanvasPattern](https://developer.mozilla.org/en-US/docs/DOM/CanvasPattern) from MDN.
|
||||
* * [CanvasPattern](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvaspattern) from whatwg.
|
||||
* * [CanvasPattern](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvaspattern) from W3C.
|
||||
*/
|
||||
/// @domName CanvasPattern; @docsEditable true
|
||||
class CanvasPattern native "*CanvasPattern" {
|
||||
}
|
||||
|
@ -823,9 +930,16 @@ class CanvasPattern native "*CanvasPattern" {
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
/**
|
||||
* A rendering context for a canvas element.
|
||||
*
|
||||
* This context is extended by [CanvasRenderingContext2D] and
|
||||
* [WebGLRenderingContext].
|
||||
*/
|
||||
/// @domName CanvasRenderingContext; @docsEditable true
|
||||
class CanvasRenderingContext native "*CanvasRenderingContext" {
|
||||
|
||||
/// Reference to the canvas element to which this context belongs.
|
||||
/// @domName CanvasRenderingContext.canvas; @docsEditable true
|
||||
final CanvasElement canvas;
|
||||
}
|
||||
|
@ -5585,6 +5699,27 @@ class DirectoryReaderSync native "*DirectoryReaderSync" {
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
/**
|
||||
* Represents an HTML <div> element.
|
||||
*
|
||||
* The [DivElement] is a generic container for content and does not have any
|
||||
* special significance. It is functionally similar to [SpanElement].
|
||||
*
|
||||
* The [DivElement] is a block-level element, as opposed to [SpanElement],
|
||||
* which is an inline-level element.
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
* DivElement div = new DivElement();
|
||||
* div.text = 'Here's my new DivElem
|
||||
* document.body.elements.add(elem);
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* * [HTML <div> element](http://www.w3.org/TR/html-markup/div.html) from W3C.
|
||||
* * [Block-level element](http://www.w3.org/TR/CSS2/visuren.html#block-boxes) from W3C.
|
||||
* * [Inline-level element](http://www.w3.org/TR/CSS2/visuren.html#inline-boxes) from W3C.
|
||||
*/
|
||||
/// @domName HTMLDivElement; @docsEditable true
|
||||
class DivElement extends Element native "*HTMLDivElement" {
|
||||
|
||||
|
@ -5614,6 +5749,7 @@ class Document extends Node native "*Document"
|
|||
DocumentEvents get on =>
|
||||
new DocumentEvents(this);
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.body; @docsEditable true
|
||||
@JSName('body')
|
||||
Element $dom_body;
|
||||
|
@ -5624,6 +5760,7 @@ class Document extends Node native "*Document"
|
|||
/// @domName Document.cookie; @docsEditable true
|
||||
String cookie;
|
||||
|
||||
/// Returns the [Window] associated with the document.
|
||||
/// @domName Document.defaultView; @docsEditable true
|
||||
Window get window => _convertNativeToDart_Window(this._window);
|
||||
@JSName('defaultView')
|
||||
|
@ -5636,6 +5773,7 @@ class Document extends Node native "*Document"
|
|||
/// @domName Document.domain; @docsEditable true
|
||||
final String domain;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.head; @docsEditable true
|
||||
@JSName('head')
|
||||
final HeadElement $dom_head;
|
||||
|
@ -5643,6 +5781,7 @@ class Document extends Node native "*Document"
|
|||
/// @domName Document.implementation; @docsEditable true
|
||||
final DomImplementation implementation;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.lastModified; @docsEditable true
|
||||
@JSName('lastModified')
|
||||
final String $dom_lastModified;
|
||||
|
@ -5654,6 +5793,7 @@ class Document extends Node native "*Document"
|
|||
/// @domName Document.readyState; @docsEditable true
|
||||
final String readyState;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.referrer; @docsEditable true
|
||||
@JSName('referrer')
|
||||
final String $dom_referrer;
|
||||
|
@ -5662,39 +5802,48 @@ class Document extends Node native "*Document"
|
|||
@JSName('selectedStylesheetSet')
|
||||
String $dom_selectedStylesheetSet;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.styleSheets; @docsEditable true
|
||||
@JSName('styleSheets')
|
||||
@Returns('_StyleSheetList') @Creates('_StyleSheetList')
|
||||
final List<StyleSheet> $dom_styleSheets;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.title; @docsEditable true
|
||||
@JSName('title')
|
||||
String $dom_title;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitFullscreenElement; @docsEditable true
|
||||
@JSName('webkitFullscreenElement')
|
||||
final Element $dom_webkitFullscreenElement;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitFullscreenEnabled; @docsEditable true
|
||||
@JSName('webkitFullscreenEnabled')
|
||||
final bool $dom_webkitFullscreenEnabled;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitHidden; @docsEditable true
|
||||
@JSName('webkitHidden')
|
||||
final bool $dom_webkitHidden;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitIsFullScreen; @docsEditable true
|
||||
@JSName('webkitIsFullScreen')
|
||||
final bool $dom_webkitIsFullScreen;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitPointerLockElement; @docsEditable true
|
||||
@JSName('webkitPointerLockElement')
|
||||
final Element $dom_webkitPointerLockElement;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitVisibilityState; @docsEditable true
|
||||
@JSName('webkitVisibilityState')
|
||||
final String $dom_webkitVisibilityState;
|
||||
|
||||
/// Use the [Range] constructor instead.
|
||||
/// @domName Document.caretRangeFromPoint; @docsEditable true
|
||||
@JSName('caretRangeFromPoint')
|
||||
Range $dom_caretRangeFromPoint(int x, int y) native;
|
||||
|
@ -5706,6 +5855,7 @@ class Document extends Node native "*Document"
|
|||
/// @domName Document.createDocumentFragment; @docsEditable true
|
||||
DocumentFragment createDocumentFragment() native;
|
||||
|
||||
/// Deprecated: use new Element.tag(tagName) instead.
|
||||
/// @domName Document.createElement; @docsEditable true
|
||||
@JSName('createElement')
|
||||
Element $dom_createElement(String tagName) native;
|
||||
|
@ -5734,10 +5884,12 @@ class Document extends Node native "*Document"
|
|||
@JSName('createTouch')
|
||||
Touch _$dom_createTouch_1(LocalWindow window, target, identifier, pageX, pageY, screenX, screenY, webkitRadiusX, webkitRadiusY, webkitRotationAngle, webkitForce) native;
|
||||
|
||||
/// Use the [TouchList] constructor isntead.
|
||||
/// @domName Document.createTouchList; @docsEditable true
|
||||
@JSName('createTouchList')
|
||||
TouchList $dom_createTouchList() native;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.elementFromPoint; @docsEditable true
|
||||
@JSName('elementFromPoint')
|
||||
Element $dom_elementFromPoint(int x, int y) native;
|
||||
|
@ -5749,6 +5901,7 @@ class Document extends Node native "*Document"
|
|||
@JSName('getCSSCanvasContext')
|
||||
CanvasRenderingContext $dom_getCssCanvasContext(String contextId, String name, int width, int height) native;
|
||||
|
||||
/// Deprecated: use query("#$elementId") instead.
|
||||
/// @domName Document.getElementById; @docsEditable true
|
||||
@JSName('getElementById')
|
||||
Element $dom_getElementById(String elementId) native;
|
||||
|
@ -5783,23 +5936,28 @@ class Document extends Node native "*Document"
|
|||
/// @domName Document.queryCommandValue; @docsEditable true
|
||||
String queryCommandValue(String command) native;
|
||||
|
||||
/// Deprecated: renamed to the shorter name [query].
|
||||
/// @domName Document.querySelector; @docsEditable true
|
||||
@JSName('querySelector')
|
||||
Element $dom_querySelector(String selectors) native;
|
||||
|
||||
/// Deprecated: use query("#$elementId") instead.
|
||||
/// @domName Document.querySelectorAll; @docsEditable true
|
||||
@JSName('querySelectorAll')
|
||||
@Returns('NodeList') @Creates('NodeList')
|
||||
List<Node> $dom_querySelectorAll(String selectors) native;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitCancelFullScreen; @docsEditable true
|
||||
@JSName('webkitCancelFullScreen')
|
||||
void $dom_webkitCancelFullScreen() native;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitExitFullscreen; @docsEditable true
|
||||
@JSName('webkitExitFullscreen')
|
||||
void $dom_webkitExitFullscreen() native;
|
||||
|
||||
/// Moved to [HtmlDocument].
|
||||
/// @domName Document.webkitExitPointerLock; @docsEditable true
|
||||
@JSName('webkitExitPointerLock')
|
||||
void $dom_webkitExitPointerLock() native;
|
||||
|
@ -10027,9 +10185,28 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
|
|||
onComplete);
|
||||
|
||||
|
||||
/**
|
||||
* General constructor for any type of request (GET, POST, etc).
|
||||
*
|
||||
* This call is used in conjunction with [open]:
|
||||
*
|
||||
* var request = new HttpRequest();
|
||||
* request.open('GET', 'http://dartlang.org')
|
||||
* request.on.load.add((event) => print('Request complete'));
|
||||
*
|
||||
* is the (more verbose) equivalent of
|
||||
*
|
||||
* var request = new HttpRequest.get('http://dartlang.org',
|
||||
* (event) => print('Request complete'));
|
||||
*/
|
||||
///@docsEditable true
|
||||
factory HttpRequest() => _HttpRequestFactoryProvider.createHttpRequest();
|
||||
|
||||
/**
|
||||
* Get the set of [HttpRequestEvents] that this request can respond to.
|
||||
* Usually used when adding an EventListener, such as in
|
||||
* `document.window.on.keyDown.add((e) => print('keydown happened'))`.
|
||||
*/
|
||||
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
|
||||
HttpRequestEvents get on =>
|
||||
new HttpRequestEvents(this);
|
||||
|
@ -10044,35 +10221,119 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
|
|||
|
||||
static const int UNSENT = 0;
|
||||
|
||||
/**
|
||||
* Indicator of the current state of the request:
|
||||
*
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td>Value</td>
|
||||
* <td>State</td>
|
||||
* <td>Meaning</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>0</td>
|
||||
* <td>unsent</td>
|
||||
* <td><code>open()</code> has not yet been called</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>1</td>
|
||||
* <td>opened</td>
|
||||
* <td><code>send()</code> has not yet been called</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>2</td>
|
||||
* <td>headers received</td>
|
||||
* <td><code>sent()</code> has been called; response headers and <code>status</code> are available</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>3</td> <td>loading</td> <td><code>responseText</code> holds some data</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>4</td> <td>done</td> <td>request is complete</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
/// @domName XMLHttpRequest.readyState; @docsEditable true
|
||||
final int readyState;
|
||||
|
||||
/**
|
||||
* The data received as a reponse from the request.
|
||||
*
|
||||
* The data could be in the
|
||||
* form of a [String], [ArrayBuffer], [Document], [Blob], or json (also a
|
||||
* [String]). `null` indicates request failure.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.response; @docsEditable true
|
||||
@Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')
|
||||
final Object response;
|
||||
|
||||
/**
|
||||
* The response in string form or null on failure.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.responseText; @docsEditable true
|
||||
final String responseText;
|
||||
|
||||
/**
|
||||
* [String] telling the server the desired response format.
|
||||
*
|
||||
* Default is `String`.
|
||||
* Other options are one of 'arraybuffer', 'blob', 'document', 'json',
|
||||
* 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
|
||||
* `responseType` is set while performing a synchronous request.
|
||||
*
|
||||
* See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType)
|
||||
*/
|
||||
/// @domName XMLHttpRequest.responseType; @docsEditable true
|
||||
String responseType;
|
||||
|
||||
/**
|
||||
* The request response, or null on failure.
|
||||
*
|
||||
* The response is processed as
|
||||
* `text/xml` stream, unless responseType = 'document' and the request is
|
||||
* synchronous.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.responseXML; @docsEditable true
|
||||
@JSName('responseXML')
|
||||
final Document responseXml;
|
||||
|
||||
/**
|
||||
* The http result code from the request (200, 404, etc).
|
||||
* See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
|
||||
*/
|
||||
/// @domName XMLHttpRequest.status; @docsEditable true
|
||||
final int status;
|
||||
|
||||
/**
|
||||
* The request response string (such as "200 OK").
|
||||
* See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
|
||||
*/
|
||||
/// @domName XMLHttpRequest.statusText; @docsEditable true
|
||||
final String statusText;
|
||||
|
||||
/**
|
||||
* [EventTarget] that can hold listeners to track the progress of the request.
|
||||
* The events fired will be members of [HttpRequestUploadEvents].
|
||||
*/
|
||||
/// @domName XMLHttpRequest.upload; @docsEditable true
|
||||
final HttpRequestUpload upload;
|
||||
|
||||
/**
|
||||
* True if cross-site requests should use credentials such as cookies
|
||||
* or authorization headers; false otherwise.
|
||||
*
|
||||
* This value is ignored for same-site requests.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.withCredentials; @docsEditable true
|
||||
bool withCredentials;
|
||||
|
||||
/**
|
||||
* Stop the current request.
|
||||
*
|
||||
* The request can only be stopped if readyState is `HEADERS_RECIEVED` or
|
||||
* `LOADING`. If this method is not in the process of being sent, the method
|
||||
* has no effect.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.abort; @docsEditable true
|
||||
void abort() native;
|
||||
|
||||
|
@ -10084,15 +10345,48 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
|
|||
@JSName('dispatchEvent')
|
||||
bool $dom_dispatchEvent(Event evt) native;
|
||||
|
||||
/**
|
||||
* Retrieve all the response headers from a request.
|
||||
*
|
||||
* `null` if no headers have been received. For multipart requests,
|
||||
* `getAllResponseHeaders` will return the response headers for the current
|
||||
* part of the request.
|
||||
*
|
||||
* See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Responses)
|
||||
* for a list of common response headers.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.getAllResponseHeaders; @docsEditable true
|
||||
String getAllResponseHeaders() native;
|
||||
|
||||
/**
|
||||
* Return the response header named `header`, or `null` if not found.
|
||||
*
|
||||
* See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Responses)
|
||||
* for a list of common response headers.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.getResponseHeader; @docsEditable true
|
||||
String getResponseHeader(String header) native;
|
||||
|
||||
/**
|
||||
* Specify the desired `url`, and `method` to use in making the request.
|
||||
*
|
||||
* By default the request is done asyncronously, with no user or password
|
||||
* authentication information. If `async` is false, the request will be send
|
||||
* synchronously.
|
||||
*
|
||||
* Calling `open` again on a currently active request is equivalent to
|
||||
* calling `abort`.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.open; @docsEditable true
|
||||
void open(String method, String url, [bool async, String user, String password]) native;
|
||||
|
||||
/**
|
||||
* Specify a particular MIME type (such as `text/xml`) desired for the
|
||||
* response.
|
||||
*
|
||||
* This value must be set before the request has been sent. See also the list
|
||||
* of [common MIME types](http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types)
|
||||
*/
|
||||
/// @domName XMLHttpRequest.overrideMimeType; @docsEditable true
|
||||
void overrideMimeType(String override) native;
|
||||
|
||||
|
@ -10100,37 +10394,89 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
|
|||
@JSName('removeEventListener')
|
||||
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
|
||||
|
||||
/**
|
||||
* Send the request with any given `data`.
|
||||
*
|
||||
* See also:
|
||||
* [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send())
|
||||
* from MDN.
|
||||
*/
|
||||
/// @domName XMLHttpRequest.send; @docsEditable true
|
||||
void send([data]) native;
|
||||
|
||||
/** Sets HTTP `header` to `value`. */
|
||||
/// @domName XMLHttpRequest.setRequestHeader; @docsEditable true
|
||||
void setRequestHeader(String header, String value) native;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A class that supports listening for and dispatching events that can fire when
|
||||
* making an HTTP request.
|
||||
*
|
||||
* Here's an example of adding an event handler that executes once an HTTP
|
||||
* request has fully loaded:
|
||||
*
|
||||
* httpRequest.on.loadEnd.add((e) => myCustomLoadEndHandler(e));
|
||||
*
|
||||
* Each property of this class is a read-only pointer to an [EventListenerList].
|
||||
* That list holds all of the [EventListener]s that have registered for that
|
||||
* particular type of event that fires from an HttpRequest.
|
||||
*/
|
||||
/// @docsEditable true
|
||||
class HttpRequestEvents extends Events {
|
||||
/// @docsEditable true
|
||||
HttpRequestEvents(EventTarget _ptr) : super(_ptr);
|
||||
|
||||
/**
|
||||
* Event listeners to be notified when request has been aborted,
|
||||
* generally due to calling `httpRequest.abort()`.
|
||||
*/
|
||||
/// @docsEditable true
|
||||
EventListenerList get abort => this['abort'];
|
||||
|
||||
/**
|
||||
* Event listeners to be notified when a request has failed, such as when a
|
||||
* cross-domain error occurred or the file wasn't found on the server.
|
||||
*/
|
||||
/// @docsEditable true
|
||||
EventListenerList get error => this['error'];
|
||||
|
||||
/**
|
||||
* Event listeners to be notified once the request has completed
|
||||
* *successfully*.
|
||||
*/
|
||||
/// @docsEditable true
|
||||
EventListenerList get load => this['load'];
|
||||
|
||||
/**
|
||||
* Event listeners to be notified once the request has completed (on
|
||||
* either success or failure).
|
||||
*/
|
||||
/// @docsEditable true
|
||||
EventListenerList get loadEnd => this['loadend'];
|
||||
|
||||
/**
|
||||
* Event listeners to be notified when the request starts, once
|
||||
* `httpRequest.send()` has been called.
|
||||
*/
|
||||
/// @docsEditable true
|
||||
EventListenerList get loadStart => this['loadstart'];
|
||||
|
||||
/**
|
||||
* Event listeners to be notified when data for the request
|
||||
* is being sent or loaded.
|
||||
*
|
||||
* Progress events are fired every 50ms or for every byte transmitted,
|
||||
* whichever is less frequent.
|
||||
*/
|
||||
/// @docsEditable true
|
||||
EventListenerList get progress => this['progress'];
|
||||
|
||||
/**
|
||||
* Event listeners to be notified every time the [HttpRequest]
|
||||
* object's `readyState` changes values.
|
||||
*/
|
||||
/// @docsEditable true
|
||||
EventListenerList get readyStateChange => this['readystatechange'];
|
||||
}
|
||||
|
@ -13207,6 +13553,16 @@ class MemoryInfo native "*MemoryInfo" {
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
/**
|
||||
* An HTML <menu> element.
|
||||
*
|
||||
* A <menu> element represents an unordered list of menu commands.
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* * [Menu Element](https://developer.mozilla.org/en-US/docs/HTML/Element/menu) from MDN.
|
||||
* * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-element) from the W3C.
|
||||
*/
|
||||
/// @domName HTMLMenuElement; @docsEditable true
|
||||
class MenuElement extends Element native "*HTMLMenuElement" {
|
||||
|
||||
|
|
|
@ -5,22 +5,22 @@
|
|||
// Fake dart:html library for documentation.
|
||||
|
||||
/// The Dart HTML5 Library.
|
||||
library dart.html;
|
||||
#library("dart:html");
|
||||
|
||||
part 'interface/AbstractWorker.dartdoc';
|
||||
part 'interface/Element.dartdoc';
|
||||
part 'interface/Event.dartdoc';
|
||||
part 'interface/EventTarget.dartdoc';
|
||||
part 'interface/HttpRequest.dartdoc';
|
||||
part 'interface/MouseEvent.dartdoc';
|
||||
part 'interface/Storage.dartdoc';
|
||||
part 'interface/Node.dartdoc';
|
||||
part 'interface/UIEvent.dartdoc';
|
||||
part 'interface/WebSocket.dartdoc';
|
||||
#source('interface/AbstractWorker.dartdoc');
|
||||
#source('interface/Element.dartdoc');
|
||||
#source('interface/Event.dartdoc');
|
||||
#source('interface/EventTarget.dartdoc');
|
||||
#source('interface/HttpRequest.dartdoc');
|
||||
#source('interface/MouseEvent.dartdoc');
|
||||
#source('interface/Storage.dartdoc');
|
||||
#source('interface/Node.dartdoc');
|
||||
#source('interface/UIEvent.dartdoc');
|
||||
#source('interface/WebSocket.dartdoc');
|
||||
|
||||
// Implementation files that appear to be necessary to load the sources.
|
||||
|
||||
//part 'nodoc-src/SomeFile.dart';
|
||||
//#source('nodoc-src/SomeFile.dart');
|
||||
|
||||
// Global definitions.
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _Base64 {
|
||||
static const List<String> _encodingTable = const [
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* Utility class that holds a number of byte buffers and can deliver
|
||||
* the bytes either one by one or in chunks.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _ChunkedInputStream implements ChunkedInputStream {
|
||||
_ChunkedInputStream(InputStream this._input, int this._chunkSize)
|
||||
: _bufferList = new _BufferList() {
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
// Constants used when working with native ports.
|
||||
const int _SUCCESS_RESPONSE = 0;
|
||||
const int _ILLEGAL_ARGUMENT_RESPONSE = 1;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* [Directory] objects are used for working with directories.
|
||||
*/
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _Directory implements Directory {
|
||||
static const CREATE_REQUEST = 0;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _EventHandler {
|
||||
external static void _start();
|
||||
external static _sendData(Object sender, ReceivePort receivePort, int data);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* FileMode describes the modes in which a file can be opened.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _FileInputStream extends _BaseDataInputStream implements InputStream {
|
||||
_FileInputStream(String name)
|
||||
: _data = const [],
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* HTTP status codes.
|
||||
*/
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
// The close queue handles graceful closing of HTTP connections. When
|
||||
// a connection is added to the queue it will enter a wait state
|
||||
// waiting for all data written and possibly socket shutdown from
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
// Global constants.
|
||||
class _Const {
|
||||
// Bytes for "HTTP".
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
const String _DART_SESSION_ID = "DARTSESSID";
|
||||
|
||||
// A _HttpSession is a node in a double-linked list, with _next and _prev being
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _HttpUtils {
|
||||
static String decodeUrlEncodedString(String urlEncoded) {
|
||||
// First check the string for any encoding.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* Basic input stream which supplies binary data.
|
||||
*
|
||||
|
|
|
@ -10,47 +10,47 @@
|
|||
* This library allows you to work with files, directories,
|
||||
* sockets, processes, HTTP servers and clients, and more.
|
||||
*/
|
||||
library dart.io;
|
||||
#library('dart:io');
|
||||
|
||||
import 'dart:crypto';
|
||||
import 'dart:isolate';
|
||||
import 'dart:math';
|
||||
import 'dart:uri';
|
||||
import 'dart:utf';
|
||||
import 'dart:scalarlist';
|
||||
#import('dart:crypto');
|
||||
#import('dart:isolate');
|
||||
#import('dart:math');
|
||||
#import('dart:uri');
|
||||
#import('dart:utf');
|
||||
#import('dart:scalarlist');
|
||||
|
||||
part 'base64.dart';
|
||||
part 'buffer_list.dart';
|
||||
part 'chunked_stream.dart';
|
||||
part 'common.dart';
|
||||
part 'directory.dart';
|
||||
part 'directory_impl.dart';
|
||||
part 'eventhandler.dart';
|
||||
part 'file.dart';
|
||||
part 'file_impl.dart';
|
||||
part 'http.dart';
|
||||
part 'http_headers.dart';
|
||||
part 'http_impl.dart';
|
||||
part 'http_parser.dart';
|
||||
part 'http_session.dart';
|
||||
part 'http_utils.dart';
|
||||
part 'input_stream.dart';
|
||||
part 'list_stream.dart';
|
||||
part 'list_stream_impl.dart';
|
||||
part 'mime_multipart_parser.dart';
|
||||
part 'output_stream.dart';
|
||||
part 'path.dart';
|
||||
part 'path_impl.dart';
|
||||
part 'platform.dart';
|
||||
part 'platform_impl.dart';
|
||||
part 'process.dart';
|
||||
part 'socket.dart';
|
||||
part 'socket_stream_impl.dart';
|
||||
part 'stdio.dart';
|
||||
part 'stream_util.dart';
|
||||
part 'string_stream.dart';
|
||||
part 'timer_impl.dart';
|
||||
part 'secure_socket.dart';
|
||||
part 'secure_server_socket.dart';
|
||||
part 'websocket.dart';
|
||||
part 'websocket_impl.dart';
|
||||
#source('base64.dart');
|
||||
#source('buffer_list.dart');
|
||||
#source('chunked_stream.dart');
|
||||
#source('common.dart');
|
||||
#source('directory.dart');
|
||||
#source('directory_impl.dart');
|
||||
#source('eventhandler.dart');
|
||||
#source('file.dart');
|
||||
#source('file_impl.dart');
|
||||
#source('http.dart');
|
||||
#source('http_headers.dart');
|
||||
#source('http_impl.dart');
|
||||
#source('http_parser.dart');
|
||||
#source('http_session.dart');
|
||||
#source('http_utils.dart');
|
||||
#source('input_stream.dart');
|
||||
#source('list_stream.dart');
|
||||
#source('list_stream_impl.dart');
|
||||
#source('mime_multipart_parser.dart');
|
||||
#source('output_stream.dart');
|
||||
#source('path.dart');
|
||||
#source('path_impl.dart');
|
||||
#source('platform.dart');
|
||||
#source('platform_impl.dart');
|
||||
#source('process.dart');
|
||||
#source('socket.dart');
|
||||
#source('socket_stream_impl.dart');
|
||||
#source('stdio.dart');
|
||||
#source('stream_util.dart');
|
||||
#source('string_stream.dart');
|
||||
#source('timer_impl.dart');
|
||||
#source('secure_socket.dart');
|
||||
#source('secure_server_socket.dart');
|
||||
#source('websocket.dart');
|
||||
#source('websocket_impl.dart');
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* [ListInputStream] makes it possible to use the [InputStream]
|
||||
* interface to stream over data that is received in chunks as lists
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* Default implementation of [ListInputStream].
|
||||
*/
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* Parser for MIME multipart types of data as described in RFC 2046
|
||||
* section 5.1.1. The data to parse is supplied through the [:update:]
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* Output streams are used to write data sequentially to a data
|
||||
* destination e.g. a connected socket or an open file.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* A Path, which is a String interpreted as a sequence of path segments,
|
||||
* which are strings, separated by forward slashes.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _Path implements Path {
|
||||
final String _path;
|
||||
final bool isWindowsShare;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* The [Platform] class exposes details of the machine and operating
|
||||
* system.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _Platform {
|
||||
external static int _numberOfProcessors();
|
||||
external static String _pathSeparator();
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
// TODO(ager): The only reason for this class is that we
|
||||
// cannot patch a top-level at this point.
|
||||
class _ProcessUtils {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
abstract class SecureServerSocket implements ServerSocket {
|
||||
/**
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* SecureSocket provides a secure (SSL or TLS) client connection to a server.
|
||||
* The certificate provided by the server is checked
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
abstract class ServerSocket {
|
||||
/**
|
||||
* Constructs a new server socket, binds it to a given address and port,
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _SocketInputStream implements InputStream {
|
||||
_SocketInputStream(Socket socket) : _socket = socket {
|
||||
if (_socket._closed) _closed = true;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
const int _STDIO_HANDLE_TYPE_TERMINAL = 0;
|
||||
const int _STDIO_HANDLE_TYPE_PIPE = 1;
|
||||
const int _STDIO_HANDLE_TYPE_FILE = 2;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
abstract class _BaseDataInputStream {
|
||||
int available();
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
// Interface for decoders decoding binary data into string data. The
|
||||
// decoder keeps track of line breaks during decoding.
|
||||
abstract class _StringDecoder {
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
class _Timer implements Timer {
|
||||
// Set jitter to wake up timer events that would happen in _TIMER_JITTER ms.
|
||||
static const int _TIMER_JITTER = 0;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
/**
|
||||
* Web socket status codes used when closing a web socket connection.
|
||||
*/
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.io;
|
||||
|
||||
const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
|
||||
|
||||
class _WebSocketMessageType {
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.isolate;
|
||||
|
||||
class IsolateSpawnException implements Exception {
|
||||
const IsolateSpawnException(String this._s);
|
||||
String toString() => "IsolateSpawnException: '$_s'";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library dart.isolate;
|
||||
#library("dart:isolate");
|
||||
|
||||
part "base.dart";
|
||||
part "timer.dart";
|
||||
#source("base.dart");
|
||||
#source("timer.dart");
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.isolate;
|
||||
|
||||
abstract class Timer {
|
||||
/**
|
||||
* Creates a new timer. The [callback] callback is invoked after
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library dart.json;
|
||||
#library("dart:json");
|
||||
|
||||
import 'dart:math';
|
||||
#import('dart:math');
|
||||
|
||||
// JSON parsing and serialization.
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.math;
|
||||
// A part of the dart:math library.
|
||||
|
||||
/**
|
||||
* Base of the natural logarithms.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library dart.math;
|
||||
#library("dart:math");
|
||||
|
||||
part "base.dart";
|
||||
part "random.dart";
|
||||
#source("base.dart");
|
||||
#source("random.dart");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.math;
|
||||
// A part of the dart:math library.
|
||||
|
||||
/**
|
||||
* A random number generator. The default implementation supplies a stream of
|
||||
|
|
|
@ -1,744 +0,0 @@
|
|||
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// Commented out until supported by VM.
|
||||
// part of dart.mirrors;
|
||||
|
||||
// For the purposes of the mirrors library, we adopt a naming
|
||||
// convention with respect to getters and setters. Specifically, for
|
||||
// some variable or field...
|
||||
//
|
||||
// var myField;
|
||||
//
|
||||
// ...the getter is named 'myField' and the setter is named
|
||||
// 'myField='. This allows us to assign unique names to getters and
|
||||
// setters for the purposes of member lookup.
|
||||
|
||||
/**
|
||||
* A [MirrorSystem] is the main interface used to reflect on a set of
|
||||
* associated libraries.
|
||||
*
|
||||
* At runtime each running isolate has a distinct [MirrorSystem].
|
||||
*
|
||||
* It is also possible to have a [MirrorSystem] which represents a set
|
||||
* of libraries which are not running -- perhaps at compile-time. In
|
||||
* this case, all available reflective functionality would be
|
||||
* supported, but runtime functionality (such as invoking a function
|
||||
* or inspecting the contents of a variable) would fail dynamically.
|
||||
*/
|
||||
abstract class MirrorSystem {
|
||||
/**
|
||||
* An immutable map from from library names to mirrors for all
|
||||
* libraries known to this mirror system.
|
||||
*/
|
||||
Map<String, LibraryMirror> get libraries;
|
||||
|
||||
/**
|
||||
* A mirror on the isolate associated with this [MirrorSystem].
|
||||
* This may be null if this mirror system is not running.
|
||||
*/
|
||||
IsolateMirror get isolate;
|
||||
|
||||
/**
|
||||
* A mirror on the [:dynamic:] type.
|
||||
*/
|
||||
TypeMirror get dynamicType;
|
||||
|
||||
/**
|
||||
* A mirror on the [:void:] type.
|
||||
*/
|
||||
TypeMirror get voidType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [MirrorSystem] for the current isolate.
|
||||
*/
|
||||
MirrorSystem currentMirrorSystem() {
|
||||
return _Mirrors.currentMirrorSystem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a [MirrorSystem] for the isolate which is listening on
|
||||
* the [SendPort].
|
||||
*/
|
||||
Future<MirrorSystem> mirrorSystemOf(SendPort port) {
|
||||
return _Mirrors.mirrorSystemOf(port);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an [InstanceMirror] for some Dart language object.
|
||||
*
|
||||
* This only works if this mirror system is associated with the
|
||||
* current running isolate.
|
||||
*/
|
||||
InstanceMirror reflect(Object reflectee) {
|
||||
return _Mirrors.reflect(reflectee);
|
||||
}
|
||||
|
||||
/**
|
||||
* A [Mirror] reflects some Dart language entity.
|
||||
*
|
||||
* Every [Mirror] originates from some [MirrorSystem].
|
||||
*/
|
||||
abstract class Mirror {
|
||||
/**
|
||||
* The [MirrorSystem] that contains this mirror.
|
||||
*/
|
||||
MirrorSystem get mirrors;
|
||||
}
|
||||
|
||||
/**
|
||||
* An [IsolateMirror] reflects an isolate.
|
||||
*/
|
||||
abstract class IsolateMirror implements Mirror {
|
||||
/**
|
||||
* A unique name used to refer to an isolate in debugging messages.
|
||||
*/
|
||||
String get debugName;
|
||||
|
||||
/**
|
||||
* Does this mirror reflect the currently running isolate?
|
||||
*/
|
||||
bool get isCurrent;
|
||||
|
||||
/**
|
||||
* A mirror on the root library for this isolate.
|
||||
*/
|
||||
LibraryMirror get rootLibrary;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [DeclarationMirror] reflects some entity declared in a Dart program.
|
||||
*/
|
||||
abstract class DeclarationMirror implements Mirror {
|
||||
/**
|
||||
* The simple name for this Dart language entity.
|
||||
*
|
||||
* The simple name is in most cases the the identifier name of the
|
||||
* entity, such as 'method' for a method [:void method() {...}:] or
|
||||
* 'mylibrary' for a [:#library('mylibrary');:] declaration.
|
||||
*/
|
||||
String get simpleName;
|
||||
|
||||
/**
|
||||
* The fully-qualified name for this Dart language entity.
|
||||
*
|
||||
* This name is qualified by the name of the owner. For instance,
|
||||
* the qualified name of a method 'method' in class 'Class' in
|
||||
* library 'library' is 'library.Class.method'.
|
||||
*
|
||||
* TODO(turnidge): Specify whether this name is unique. Currently
|
||||
* this is a gray area due to lack of clarity over whether library
|
||||
* names are unique.
|
||||
*/
|
||||
String get qualifiedName;
|
||||
|
||||
/**
|
||||
* A mirror on the owner of this function. This is the declaration
|
||||
* immediately surrounding the reflectee.
|
||||
*
|
||||
* Note that for libraries, the owner will be [:null:].
|
||||
*/
|
||||
DeclarationMirror get owner;
|
||||
|
||||
/**
|
||||
* Is this declaration private?
|
||||
*
|
||||
* Note that for libraries, this will be [:false:].
|
||||
*/
|
||||
bool get isPrivate;
|
||||
|
||||
/**
|
||||
* Is this declaration top-level?
|
||||
*
|
||||
* This is defined to be equivalent to:
|
||||
* [:mirror.owner != null && mirror.owner is LibraryMirror:]
|
||||
*/
|
||||
bool get isTopLevel;
|
||||
|
||||
/**
|
||||
* The source location of this Dart language entity.
|
||||
*/
|
||||
SourceLocation get location;
|
||||
}
|
||||
|
||||
/**
|
||||
* An [ObjectMirror] is a common superinterface of [InstanceMirror],
|
||||
* [ClassMirror], and [LibraryMirror] that represents their shared
|
||||
* functionality.
|
||||
*
|
||||
* For the purposes of the mirrors library, these types are all
|
||||
* object-like, in that they support method invocation and field
|
||||
* access. Real Dart objects are represented by the [InstanceMirror]
|
||||
* type.
|
||||
*
|
||||
* See [InstanceMirror], [ClassMirror], and [LibraryMirror].
|
||||
*/
|
||||
abstract class ObjectMirror implements Mirror {
|
||||
/**
|
||||
* Invokes the named function and returns a mirror on the result.
|
||||
*
|
||||
* TODO(turnidge): Properly document.
|
||||
* TODO(turnidge): Handle ambiguous names.
|
||||
* TODO(turnidge): Handle optional & named arguments.
|
||||
*/
|
||||
Future<InstanceMirror> invoke(String memberName,
|
||||
List<Object> positionalArguments,
|
||||
[Map<String,Object> namedArguments]);
|
||||
|
||||
/**
|
||||
* Invokes a getter and returns a mirror on the result. The getter
|
||||
* can be the implicit getter for a field or a user-defined getter
|
||||
* method.
|
||||
*
|
||||
* TODO(turnidge): Handle ambiguous names.
|
||||
*/
|
||||
Future<InstanceMirror> getField(String fieldName);
|
||||
|
||||
/**
|
||||
* Invokes a setter and returns a mirror on the result. The setter
|
||||
* may be either the implicit setter for a non-final field or a
|
||||
* user-defined setter method.
|
||||
*
|
||||
* TODO(turnidge): Handle ambiguous names.
|
||||
*/
|
||||
Future<InstanceMirror> setField(String fieldName, Object value);
|
||||
}
|
||||
|
||||
/**
|
||||
* An [InstanceMirror] reflects an instance of a Dart language object.
|
||||
*/
|
||||
abstract class InstanceMirror implements ObjectMirror {
|
||||
/**
|
||||
* A mirror on the type of the reflectee.
|
||||
*/
|
||||
ClassMirror get type;
|
||||
|
||||
/**
|
||||
* Does [reflectee] contain the instance reflected by this mirror?
|
||||
* This will always be true in the local case (reflecting instances
|
||||
* in the same isolate), but only true in the remote case if this
|
||||
* mirror reflects a simple value.
|
||||
*
|
||||
* A value is simple if one of the following holds:
|
||||
* - the value is null
|
||||
* - the value is of type [num]
|
||||
* - the value is of type [bool]
|
||||
* - the value is of type [String]
|
||||
*/
|
||||
bool get hasReflectee;
|
||||
|
||||
/**
|
||||
* If the [InstanceMirror] reflects an instance it is meaningful to
|
||||
* have a local reference to, we provide access to the actual
|
||||
* instance here.
|
||||
*
|
||||
* If you access [reflectee] when [hasReflectee] is false, an
|
||||
* exception is thrown.
|
||||
*/
|
||||
get reflectee;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [ClosureMirror] reflects a closure.
|
||||
*
|
||||
* A [ClosureMirror] provides access to its captured variables and
|
||||
* provides the ability to execute its reflectee.
|
||||
*/
|
||||
abstract class ClosureMirror implements InstanceMirror {
|
||||
/**
|
||||
* A mirror on the function associated with this closure.
|
||||
*/
|
||||
MethodMirror get function;
|
||||
|
||||
/**
|
||||
* The source code for this closure, if available. Otherwise null.
|
||||
*
|
||||
* TODO(turnidge): Would this just be available in function?
|
||||
*/
|
||||
String get source;
|
||||
|
||||
/**
|
||||
* Executes the closure. The arguments given in the descriptor need to
|
||||
* be InstanceMirrors or simple values.
|
||||
*
|
||||
* A value is simple if one of the following holds:
|
||||
* - the value is null
|
||||
* - the value is of type [num]
|
||||
* - the value is of type [bool]
|
||||
* - the value is of type [String]
|
||||
*/
|
||||
Future<InstanceMirror> apply(List<Object> positionalArguments,
|
||||
[Map<String,Object> namedArguments]);
|
||||
|
||||
/**
|
||||
* Looks up the value of a name in the scope of the closure. The
|
||||
* result is a mirror on that value.
|
||||
*/
|
||||
Future<InstanceMirror> findInContext(String name);
|
||||
}
|
||||
|
||||
/**
|
||||
* A [LibraryMirror] reflects a Dart language library, providing
|
||||
* access to the variables, functions, and classes of the
|
||||
* library.
|
||||
*/
|
||||
abstract class LibraryMirror implements DeclarationMirror, ObjectMirror {
|
||||
/**
|
||||
* The url of the library.
|
||||
*
|
||||
* TODO(turnidge): Document where this url comes from. Will this
|
||||
* value be sensible?
|
||||
*/
|
||||
String get url;
|
||||
|
||||
/**
|
||||
* An immutable map from from names to mirrors for all members in
|
||||
* this library.
|
||||
*
|
||||
* The members of a library are its top-level classes,
|
||||
* functions, variables, getters, and setters.
|
||||
*/
|
||||
Map<String, Mirror> get members;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all class
|
||||
* declarations in this library.
|
||||
*/
|
||||
Map<String, ClassMirror> get classes;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all function, getter,
|
||||
* and setter declarations in this library.
|
||||
*/
|
||||
Map<String, MethodMirror> get functions;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all getter
|
||||
* declarations in this library.
|
||||
*/
|
||||
Map<String, MethodMirror> get getters;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all setter
|
||||
* declarations in this library.
|
||||
*/
|
||||
Map<String, MethodMirror> get setters;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all variable
|
||||
* declarations in this library.
|
||||
*/
|
||||
Map<String, VariableMirror> get variables;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [TypeMirror] reflects a Dart language class, typedef
|
||||
* or type variable.
|
||||
*/
|
||||
abstract class TypeMirror implements DeclarationMirror {
|
||||
}
|
||||
|
||||
/**
|
||||
* A [ClassMirror] reflects a Dart language class.
|
||||
*/
|
||||
abstract class ClassMirror implements TypeMirror, ObjectMirror {
|
||||
/**
|
||||
* A mirror on the superclass on the reflectee.
|
||||
*
|
||||
* If this type is [:Object:] or a typedef, the superClass will be
|
||||
* null.
|
||||
*/
|
||||
ClassMirror get superclass;
|
||||
|
||||
/**
|
||||
* A list of mirrors on the superinterfaces of the reflectee.
|
||||
*/
|
||||
List<ClassMirror> get superinterfaces;
|
||||
|
||||
/**
|
||||
* An immutable map from from names to mirrors for all members of
|
||||
* this type.
|
||||
*
|
||||
* The members of a type are its methods, fields, getters, and
|
||||
* setters. Note that constructors and type variables are not
|
||||
* considered to be members of a type.
|
||||
*
|
||||
* This does not include inherited members.
|
||||
*/
|
||||
Map<String, Mirror> get members;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all method,
|
||||
* declarations for this type. This does not include getters and
|
||||
* setters.
|
||||
*/
|
||||
Map<String, MethodMirror> get methods;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all getter
|
||||
* declarations for this type.
|
||||
*/
|
||||
Map<String, MethodMirror> get getters;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all setter
|
||||
* declarations for this type.
|
||||
*/
|
||||
Map<String, MethodMirror> get setters;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all variable
|
||||
* declarations for this type.
|
||||
*/
|
||||
Map<String, VariableMirror> get variables;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all constructor
|
||||
* declarations for this type.
|
||||
*/
|
||||
Map<String, MethodMirror> get constructors;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all type variables for
|
||||
* this type.
|
||||
*
|
||||
* This map preserves the order of declaration of the type variables.
|
||||
*/
|
||||
Map<String, TypeVariableMirror> get typeVariables;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all type arguments for
|
||||
* this type.
|
||||
*
|
||||
* This map preserves the order of declaration of the type variables.
|
||||
*/
|
||||
Map<String, TypeMirror> get typeArguments;
|
||||
|
||||
/**
|
||||
* Is this the original declaration of this type?
|
||||
*
|
||||
* For most classes, they are their own original declaration. For
|
||||
* generic classes, however, there is a distinction between the
|
||||
* original class declaration, which has unbound type variables, and
|
||||
* the instantiations of generic classes, which have bound type
|
||||
* variables.
|
||||
*/
|
||||
bool get isOriginalDeclaration;
|
||||
|
||||
/**
|
||||
* A mirror on the original declaration of this type.
|
||||
*
|
||||
* For most classes, they are their own original declaration. For
|
||||
* generic classes, however, there is a distinction between the
|
||||
* original class declaration, which has unbound type variables, and
|
||||
* the instantiations of generic classes, which have bound type
|
||||
* variables.
|
||||
*/
|
||||
ClassMirror get originalDeclaration;
|
||||
|
||||
/**
|
||||
* Invokes the named constructor and returns a mirror on the result.
|
||||
*
|
||||
* TODO(turnidge): Properly document.
|
||||
*/
|
||||
Future<InstanceMirror> newInstance(String constructorName,
|
||||
List<Object> positionalArguments,
|
||||
[Map<String,Object> namedArguments]);
|
||||
|
||||
/**
|
||||
* Does this mirror represent a class?
|
||||
*
|
||||
* TODO(turnidge): This functions goes away after the
|
||||
* class/interface changes.
|
||||
*/
|
||||
bool get isClass;
|
||||
|
||||
/**
|
||||
* A mirror on the default factory class or null if there is none.
|
||||
*
|
||||
* TODO(turnidge): This functions goes away after the
|
||||
* class/interface changes.
|
||||
*/
|
||||
ClassMirror get defaultFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [FunctionTypeMirror] represents the type of a function in the
|
||||
* Dart language.
|
||||
*/
|
||||
abstract class FunctionTypeMirror implements ClassMirror {
|
||||
/**
|
||||
* The return type of the reflectee.
|
||||
*/
|
||||
TypeMirror get returnType;
|
||||
|
||||
/**
|
||||
* A list of the parameter types of the reflectee.
|
||||
*/
|
||||
List<ParameterMirror> get parameters;
|
||||
|
||||
/**
|
||||
* A mirror on the [:call:] method for the reflectee.
|
||||
*
|
||||
* TODO(turnidge): What is this and what is it for?
|
||||
*/
|
||||
MethodMirror get callMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [TypeVariableMirror] represents a type parameter of a generic
|
||||
* type.
|
||||
*/
|
||||
abstract class TypeVariableMirror extends TypeMirror {
|
||||
/**
|
||||
* A mirror on the type that is the upper bound of this type variable.
|
||||
*/
|
||||
TypeMirror get upperBound;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [TypedefMirror] represents a typedef in a Dart language program.
|
||||
*/
|
||||
abstract class TypedefMirror implements ClassMirror {
|
||||
/**
|
||||
* The defining type for this typedef.
|
||||
*
|
||||
* For instance [:void f(int):] is the value for [:typedef void f(int):].
|
||||
*/
|
||||
TypeMirror get value;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [MethodMirror] reflects a Dart language function, method,
|
||||
* constructor, getter, or setter.
|
||||
*/
|
||||
abstract class MethodMirror implements DeclarationMirror {
|
||||
/**
|
||||
* A mirror on the return type for the reflectee.
|
||||
*/
|
||||
TypeMirror get returnType;
|
||||
|
||||
/**
|
||||
* A list of mirrors on the parameters for the reflectee.
|
||||
*/
|
||||
List<ParameterMirror> get parameters;
|
||||
|
||||
/**
|
||||
* Is the reflectee static?
|
||||
*
|
||||
* For the purposes of the mirrors library, a top-level function is
|
||||
* considered static.
|
||||
*/
|
||||
bool get isStatic;
|
||||
|
||||
/**
|
||||
* Is the reflectee abstract?
|
||||
*/
|
||||
bool get isAbstract;
|
||||
|
||||
/**
|
||||
* Is the reflectee a regular function or method?
|
||||
*
|
||||
* A function or method is regular if it is not a getter, setter, or
|
||||
* constructor. Note that operators, by this definition, are
|
||||
* regular methods.
|
||||
*/
|
||||
bool get isRegularMethod;
|
||||
|
||||
/**
|
||||
* Is the reflectee an operator?
|
||||
*/
|
||||
bool get isOperator;
|
||||
|
||||
/**
|
||||
* Is the reflectee a getter?
|
||||
*/
|
||||
bool get isGetter;
|
||||
|
||||
/**
|
||||
* Is the reflectee a setter?
|
||||
*/
|
||||
bool get isSetter;
|
||||
|
||||
/**
|
||||
* Is the reflectee a constructor?
|
||||
*/
|
||||
bool get isConstructor;
|
||||
|
||||
/**
|
||||
* The constructor name for named constructors and factory methods.
|
||||
*
|
||||
* For unnamed constructors, this is the empty string. For
|
||||
* non-constructors, this is the empty string.
|
||||
*
|
||||
* For example, [:'bar':] is the constructor name for constructor
|
||||
* [:Foo.bar:] of type [:Foo:].
|
||||
*/
|
||||
String get constructorName;
|
||||
|
||||
/**
|
||||
* Is the reflectee a const constructor?
|
||||
*/
|
||||
bool get isConstConstructor;
|
||||
|
||||
/**
|
||||
* Is the reflectee a generative constructor?
|
||||
*/
|
||||
bool get isGenerativeConstructor;
|
||||
|
||||
/**
|
||||
* Is the reflectee a redirecting constructor?
|
||||
*/
|
||||
bool get isRedirectingConstructor;
|
||||
|
||||
/**
|
||||
* Is the reflectee a factory constructor?
|
||||
*/
|
||||
bool get isFactoryConstructor;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [VariableMirror] reflects a Dart language variable declaration.
|
||||
*/
|
||||
abstract class VariableMirror implements DeclarationMirror {
|
||||
/**
|
||||
* A mirror on the type of the reflectee.
|
||||
*/
|
||||
TypeMirror get type;
|
||||
|
||||
/**
|
||||
* Is the reflectee a static variable?
|
||||
*
|
||||
* For the purposes of the mirror library, top-level variables are
|
||||
* implicitly declared static.
|
||||
*/
|
||||
bool get isStatic;
|
||||
|
||||
/**
|
||||
* Is the reflectee a final variable?
|
||||
*/
|
||||
bool get isFinal;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [ParameterMirror] reflects a Dart formal parameter declaration.
|
||||
*/
|
||||
abstract class ParameterMirror implements VariableMirror {
|
||||
/**
|
||||
* A mirror on the type of this parameter.
|
||||
*/
|
||||
TypeMirror get type;
|
||||
|
||||
/**
|
||||
* Is this parameter optional?
|
||||
*/
|
||||
bool get isOptional;
|
||||
|
||||
/**
|
||||
* Is this parameter named?
|
||||
*/
|
||||
bool get isNamed;
|
||||
|
||||
/**
|
||||
* Does this parameter have a default value?
|
||||
*/
|
||||
bool get hasDefaultValue;
|
||||
|
||||
/**
|
||||
* A mirror on the default value for this parameter, if it exists.
|
||||
*
|
||||
* TODO(turnidge): String may not be a good representation of this
|
||||
* at runtime.
|
||||
*/
|
||||
String get defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [SourceLocation] describes the span of an entity in Dart source code.
|
||||
*/
|
||||
abstract class SourceLocation {
|
||||
}
|
||||
|
||||
/**
|
||||
* When an error occurs during the mirrored execution of code, a
|
||||
* [MirroredError] is thrown.
|
||||
*
|
||||
* In general, there are three main classes of failure that can happen
|
||||
* during mirrored execution of code in some isolate:
|
||||
*
|
||||
* - An exception is thrown but not caught. This is caught by the
|
||||
* mirrors framework and a [MirroredUncaughtExceptionError] is
|
||||
* created and thrown.
|
||||
*
|
||||
* - A compile-time error occurs, such as a syntax error. This is
|
||||
* suppressed by the mirrors framework and a
|
||||
* [MirroredCompilationError] is created and thrown.
|
||||
*
|
||||
* - A truly fatal error occurs, causing the isolate to be exited. If
|
||||
* the reflector and reflectee share the same isolate, then they
|
||||
* will both suffer. If the reflector and reflectee are in distinct
|
||||
* isolates, then we hope to provide some information about the
|
||||
* isolate death, but this has yet to be implemented.
|
||||
*
|
||||
* TODO(turnidge): Specify the behavior for remote fatal errors.
|
||||
*/
|
||||
abstract class MirroredError implements Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* When an uncaught exception occurs during the mirrored execution
|
||||
* of code, a [MirroredUncaughtExceptionError] is thrown.
|
||||
*
|
||||
* This exception contains a mirror on the original exception object.
|
||||
* It also contains an object which can be used to recover the
|
||||
* stacktrace.
|
||||
*/
|
||||
class MirroredUncaughtExceptionError extends MirroredError {
|
||||
MirroredUncaughtExceptionError(this.exception_mirror,
|
||||
this.exception_string,
|
||||
this.stacktrace) {}
|
||||
|
||||
/** A mirror on the exception object. */
|
||||
final InstanceMirror exception_mirror;
|
||||
|
||||
/** The result of toString() for the exception object. */
|
||||
final String exception_string;
|
||||
|
||||
/** A stacktrace object for the uncaught exception. */
|
||||
final Object stacktrace;
|
||||
|
||||
String toString() {
|
||||
return
|
||||
"Uncaught exception during mirrored execution: <${exception_string}>";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When a compile-time error occurs during the mirrored execution
|
||||
* of code, a [MirroredCompilationError] is thrown.
|
||||
*
|
||||
* This exception includes the compile-time error message that would
|
||||
* have been displayed to the user, if the function had not been
|
||||
* invoked via mirror.
|
||||
*/
|
||||
class MirroredCompilationError extends MirroredError {
|
||||
MirroredCompilationError(this.message) {}
|
||||
|
||||
final String message;
|
||||
|
||||
String toString() {
|
||||
return "Compile-time error during mirrored execution: <$message>";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A [MirrorException] is used to indicate errors within the mirrors
|
||||
* framework.
|
||||
*/
|
||||
class MirrorException implements Exception {
|
||||
const MirrorException(String this._message);
|
||||
String toString() => "MirrorException: '$_message'";
|
||||
final String _message;
|
||||
}
|
|
@ -3,7 +3,743 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// The dart:mirrors library provides reflective access for Dart program.
|
||||
//
|
||||
// For the purposes of the mirrors library, we adopt a naming
|
||||
// convention with respect to getters and setters. Specifically, for
|
||||
// some variable or field...
|
||||
//
|
||||
// var myField;
|
||||
//
|
||||
// ...the getter is named 'myField' and the setter is named
|
||||
// 'myField='. This allows us to assign unique names to getters and
|
||||
// setters for the purposes of member lookup.
|
||||
|
||||
library dart.mirrors;
|
||||
// #library("mirrors");
|
||||
|
||||
part "mirror_classes.dart";
|
||||
/**
|
||||
* A [MirrorSystem] is the main interface used to reflect on a set of
|
||||
* associated libraries.
|
||||
*
|
||||
* At runtime each running isolate has a distinct [MirrorSystem].
|
||||
*
|
||||
* It is also possible to have a [MirrorSystem] which represents a set
|
||||
* of libraries which are not running -- perhaps at compile-time. In
|
||||
* this case, all available reflective functionality would be
|
||||
* supported, but runtime functionality (such as invoking a function
|
||||
* or inspecting the contents of a variable) would fail dynamically.
|
||||
*/
|
||||
abstract class MirrorSystem {
|
||||
/**
|
||||
* An immutable map from from library names to mirrors for all
|
||||
* libraries known to this mirror system.
|
||||
*/
|
||||
Map<String, LibraryMirror> get libraries;
|
||||
|
||||
/**
|
||||
* A mirror on the isolate associated with this [MirrorSystem].
|
||||
* This may be null if this mirror system is not running.
|
||||
*/
|
||||
IsolateMirror get isolate;
|
||||
|
||||
/**
|
||||
* A mirror on the [:dynamic:] type.
|
||||
*/
|
||||
TypeMirror get dynamicType;
|
||||
|
||||
/**
|
||||
* A mirror on the [:void:] type.
|
||||
*/
|
||||
TypeMirror get voidType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [MirrorSystem] for the current isolate.
|
||||
*/
|
||||
MirrorSystem currentMirrorSystem() {
|
||||
return _Mirrors.currentMirrorSystem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a [MirrorSystem] for the isolate which is listening on
|
||||
* the [SendPort].
|
||||
*/
|
||||
Future<MirrorSystem> mirrorSystemOf(SendPort port) {
|
||||
return _Mirrors.mirrorSystemOf(port);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an [InstanceMirror] for some Dart language object.
|
||||
*
|
||||
* This only works if this mirror system is associated with the
|
||||
* current running isolate.
|
||||
*/
|
||||
InstanceMirror reflect(Object reflectee) {
|
||||
return _Mirrors.reflect(reflectee);
|
||||
}
|
||||
|
||||
/**
|
||||
* A [Mirror] reflects some Dart language entity.
|
||||
*
|
||||
* Every [Mirror] originates from some [MirrorSystem].
|
||||
*/
|
||||
abstract class Mirror {
|
||||
/**
|
||||
* The [MirrorSystem] that contains this mirror.
|
||||
*/
|
||||
MirrorSystem get mirrors;
|
||||
}
|
||||
|
||||
/**
|
||||
* An [IsolateMirror] reflects an isolate.
|
||||
*/
|
||||
abstract class IsolateMirror implements Mirror {
|
||||
/**
|
||||
* A unique name used to refer to an isolate in debugging messages.
|
||||
*/
|
||||
String get debugName;
|
||||
|
||||
/**
|
||||
* Does this mirror reflect the currently running isolate?
|
||||
*/
|
||||
bool get isCurrent;
|
||||
|
||||
/**
|
||||
* A mirror on the root library for this isolate.
|
||||
*/
|
||||
LibraryMirror get rootLibrary;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [DeclarationMirror] reflects some entity declared in a Dart program.
|
||||
*/
|
||||
abstract class DeclarationMirror implements Mirror {
|
||||
/**
|
||||
* The simple name for this Dart language entity.
|
||||
*
|
||||
* The simple name is in most cases the the identifier name of the
|
||||
* entity, such as 'method' for a method [:void method() {...}:] or
|
||||
* 'mylibrary' for a [:#library('mylibrary');:] declaration.
|
||||
*/
|
||||
String get simpleName;
|
||||
|
||||
/**
|
||||
* The fully-qualified name for this Dart language entity.
|
||||
*
|
||||
* This name is qualified by the name of the owner. For instance,
|
||||
* the qualified name of a method 'method' in class 'Class' in
|
||||
* library 'library' is 'library.Class.method'.
|
||||
*
|
||||
* TODO(turnidge): Specify whether this name is unique. Currently
|
||||
* this is a gray area due to lack of clarity over whether library
|
||||
* names are unique.
|
||||
*/
|
||||
String get qualifiedName;
|
||||
|
||||
/**
|
||||
* A mirror on the owner of this function. This is the declaration
|
||||
* immediately surrounding the reflectee.
|
||||
*
|
||||
* Note that for libraries, the owner will be [:null:].
|
||||
*/
|
||||
DeclarationMirror get owner;
|
||||
|
||||
/**
|
||||
* Is this declaration private?
|
||||
*
|
||||
* Note that for libraries, this will be [:false:].
|
||||
*/
|
||||
bool get isPrivate;
|
||||
|
||||
/**
|
||||
* Is this declaration top-level?
|
||||
*
|
||||
* This is defined to be equivalent to:
|
||||
* [:mirror.owner != null && mirror.owner is LibraryMirror:]
|
||||
*/
|
||||
bool get isTopLevel;
|
||||
|
||||
/**
|
||||
* The source location of this Dart language entity.
|
||||
*/
|
||||
SourceLocation get location;
|
||||
}
|
||||
|
||||
/**
|
||||
* An [ObjectMirror] is a common superinterface of [InstanceMirror],
|
||||
* [ClassMirror], and [LibraryMirror] that represents their shared
|
||||
* functionality.
|
||||
*
|
||||
* For the purposes of the mirrors library, these types are all
|
||||
* object-like, in that they support method invocation and field
|
||||
* access. Real Dart objects are represented by the [InstanceMirror]
|
||||
* type.
|
||||
*
|
||||
* See [InstanceMirror], [ClassMirror], and [LibraryMirror].
|
||||
*/
|
||||
abstract class ObjectMirror implements Mirror {
|
||||
/**
|
||||
* Invokes the named function and returns a mirror on the result.
|
||||
*
|
||||
* TODO(turnidge): Properly document.
|
||||
* TODO(turnidge): Handle ambiguous names.
|
||||
* TODO(turnidge): Handle optional & named arguments.
|
||||
*/
|
||||
Future<InstanceMirror> invoke(String memberName,
|
||||
List<Object> positionalArguments,
|
||||
[Map<String,Object> namedArguments]);
|
||||
|
||||
/**
|
||||
* Invokes a getter and returns a mirror on the result. The getter
|
||||
* can be the implicit getter for a field or a user-defined getter
|
||||
* method.
|
||||
*
|
||||
* TODO(turnidge): Handle ambiguous names.
|
||||
*/
|
||||
Future<InstanceMirror> getField(String fieldName);
|
||||
|
||||
/**
|
||||
* Invokes a setter and returns a mirror on the result. The setter
|
||||
* may be either the implicit setter for a non-final field or a
|
||||
* user-defined setter method.
|
||||
*
|
||||
* TODO(turnidge): Handle ambiguous names.
|
||||
*/
|
||||
Future<InstanceMirror> setField(String fieldName, Object value);
|
||||
}
|
||||
|
||||
/**
|
||||
* An [InstanceMirror] reflects an instance of a Dart language object.
|
||||
*/
|
||||
abstract class InstanceMirror implements ObjectMirror {
|
||||
/**
|
||||
* A mirror on the type of the reflectee.
|
||||
*/
|
||||
ClassMirror get type;
|
||||
|
||||
/**
|
||||
* Does [reflectee] contain the instance reflected by this mirror?
|
||||
* This will always be true in the local case (reflecting instances
|
||||
* in the same isolate), but only true in the remote case if this
|
||||
* mirror reflects a simple value.
|
||||
*
|
||||
* A value is simple if one of the following holds:
|
||||
* - the value is null
|
||||
* - the value is of type [num]
|
||||
* - the value is of type [bool]
|
||||
* - the value is of type [String]
|
||||
*/
|
||||
bool get hasReflectee;
|
||||
|
||||
/**
|
||||
* If the [InstanceMirror] reflects an instance it is meaningful to
|
||||
* have a local reference to, we provide access to the actual
|
||||
* instance here.
|
||||
*
|
||||
* If you access [reflectee] when [hasReflectee] is false, an
|
||||
* exception is thrown.
|
||||
*/
|
||||
get reflectee;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [ClosureMirror] reflects a closure.
|
||||
*
|
||||
* A [ClosureMirror] provides access to its captured variables and
|
||||
* provides the ability to execute its reflectee.
|
||||
*/
|
||||
abstract class ClosureMirror implements InstanceMirror {
|
||||
/**
|
||||
* A mirror on the function associated with this closure.
|
||||
*/
|
||||
MethodMirror get function;
|
||||
|
||||
/**
|
||||
* The source code for this closure, if available. Otherwise null.
|
||||
*
|
||||
* TODO(turnidge): Would this just be available in function?
|
||||
*/
|
||||
String get source;
|
||||
|
||||
/**
|
||||
* Executes the closure. The arguments given in the descriptor need to
|
||||
* be InstanceMirrors or simple values.
|
||||
*
|
||||
* A value is simple if one of the following holds:
|
||||
* - the value is null
|
||||
* - the value is of type [num]
|
||||
* - the value is of type [bool]
|
||||
* - the value is of type [String]
|
||||
*/
|
||||
Future<InstanceMirror> apply(List<Object> positionalArguments,
|
||||
[Map<String,Object> namedArguments]);
|
||||
|
||||
/**
|
||||
* Looks up the value of a name in the scope of the closure. The
|
||||
* result is a mirror on that value.
|
||||
*/
|
||||
Future<InstanceMirror> findInContext(String name);
|
||||
}
|
||||
|
||||
/**
|
||||
* A [LibraryMirror] reflects a Dart language library, providing
|
||||
* access to the variables, functions, and classes of the
|
||||
* library.
|
||||
*/
|
||||
abstract class LibraryMirror implements DeclarationMirror, ObjectMirror {
|
||||
/**
|
||||
* The url of the library.
|
||||
*
|
||||
* TODO(turnidge): Document where this url comes from. Will this
|
||||
* value be sensible?
|
||||
*/
|
||||
String get url;
|
||||
|
||||
/**
|
||||
* An immutable map from from names to mirrors for all members in
|
||||
* this library.
|
||||
*
|
||||
* The members of a library are its top-level classes,
|
||||
* functions, variables, getters, and setters.
|
||||
*/
|
||||
Map<String, Mirror> get members;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all class
|
||||
* declarations in this library.
|
||||
*/
|
||||
Map<String, ClassMirror> get classes;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all function, getter,
|
||||
* and setter declarations in this library.
|
||||
*/
|
||||
Map<String, MethodMirror> get functions;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all getter
|
||||
* declarations in this library.
|
||||
*/
|
||||
Map<String, MethodMirror> get getters;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all setter
|
||||
* declarations in this library.
|
||||
*/
|
||||
Map<String, MethodMirror> get setters;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all variable
|
||||
* declarations in this library.
|
||||
*/
|
||||
Map<String, VariableMirror> get variables;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [TypeMirror] reflects a Dart language class, typedef
|
||||
* or type variable.
|
||||
*/
|
||||
abstract class TypeMirror implements DeclarationMirror {
|
||||
}
|
||||
|
||||
/**
|
||||
* A [ClassMirror] reflects a Dart language class.
|
||||
*/
|
||||
abstract class ClassMirror implements TypeMirror, ObjectMirror {
|
||||
/**
|
||||
* A mirror on the superclass on the reflectee.
|
||||
*
|
||||
* If this type is [:Object:] or a typedef, the superClass will be
|
||||
* null.
|
||||
*/
|
||||
ClassMirror get superclass;
|
||||
|
||||
/**
|
||||
* A list of mirrors on the superinterfaces of the reflectee.
|
||||
*/
|
||||
List<ClassMirror> get superinterfaces;
|
||||
|
||||
/**
|
||||
* An immutable map from from names to mirrors for all members of
|
||||
* this type.
|
||||
*
|
||||
* The members of a type are its methods, fields, getters, and
|
||||
* setters. Note that constructors and type variables are not
|
||||
* considered to be members of a type.
|
||||
*
|
||||
* This does not include inherited members.
|
||||
*/
|
||||
Map<String, Mirror> get members;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all method,
|
||||
* declarations for this type. This does not include getters and
|
||||
* setters.
|
||||
*/
|
||||
Map<String, MethodMirror> get methods;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all getter
|
||||
* declarations for this type.
|
||||
*/
|
||||
Map<String, MethodMirror> get getters;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all setter
|
||||
* declarations for this type.
|
||||
*/
|
||||
Map<String, MethodMirror> get setters;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all variable
|
||||
* declarations for this type.
|
||||
*/
|
||||
Map<String, VariableMirror> get variables;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all constructor
|
||||
* declarations for this type.
|
||||
*/
|
||||
Map<String, MethodMirror> get constructors;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all type variables for
|
||||
* this type.
|
||||
*
|
||||
* This map preserves the order of declaration of the type variables.
|
||||
*/
|
||||
Map<String, TypeVariableMirror> get typeVariables;
|
||||
|
||||
/**
|
||||
* An immutable map from names to mirrors for all type arguments for
|
||||
* this type.
|
||||
*
|
||||
* This map preserves the order of declaration of the type variables.
|
||||
*/
|
||||
Map<String, TypeMirror> get typeArguments;
|
||||
|
||||
/**
|
||||
* Is this the original declaration of this type?
|
||||
*
|
||||
* For most classes, they are their own original declaration. For
|
||||
* generic classes, however, there is a distinction between the
|
||||
* original class declaration, which has unbound type variables, and
|
||||
* the instantiations of generic classes, which have bound type
|
||||
* variables.
|
||||
*/
|
||||
bool get isOriginalDeclaration;
|
||||
|
||||
/**
|
||||
* A mirror on the original declaration of this type.
|
||||
*
|
||||
* For most classes, they are their own original declaration. For
|
||||
* generic classes, however, there is a distinction between the
|
||||
* original class declaration, which has unbound type variables, and
|
||||
* the instantiations of generic classes, which have bound type
|
||||
* variables.
|
||||
*/
|
||||
ClassMirror get originalDeclaration;
|
||||
|
||||
/**
|
||||
* Invokes the named constructor and returns a mirror on the result.
|
||||
*
|
||||
* TODO(turnidge): Properly document.
|
||||
*/
|
||||
Future<InstanceMirror> newInstance(String constructorName,
|
||||
List<Object> positionalArguments,
|
||||
[Map<String,Object> namedArguments]);
|
||||
|
||||
/**
|
||||
* Does this mirror represent a class?
|
||||
*
|
||||
* TODO(turnidge): This functions goes away after the
|
||||
* class/interface changes.
|
||||
*/
|
||||
bool get isClass;
|
||||
|
||||
/**
|
||||
* A mirror on the default factory class or null if there is none.
|
||||
*
|
||||
* TODO(turnidge): This functions goes away after the
|
||||
* class/interface changes.
|
||||
*/
|
||||
ClassMirror get defaultFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [FunctionTypeMirror] represents the type of a function in the
|
||||
* Dart language.
|
||||
*/
|
||||
abstract class FunctionTypeMirror implements ClassMirror {
|
||||
/**
|
||||
* The return type of the reflectee.
|
||||
*/
|
||||
TypeMirror get returnType;
|
||||
|
||||
/**
|
||||
* A list of the parameter types of the reflectee.
|
||||
*/
|
||||
List<ParameterMirror> get parameters;
|
||||
|
||||
/**
|
||||
* A mirror on the [:call:] method for the reflectee.
|
||||
*
|
||||
* TODO(turnidge): What is this and what is it for?
|
||||
*/
|
||||
MethodMirror get callMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [TypeVariableMirror] represents a type parameter of a generic
|
||||
* type.
|
||||
*/
|
||||
abstract class TypeVariableMirror extends TypeMirror {
|
||||
/**
|
||||
* A mirror on the type that is the upper bound of this type variable.
|
||||
*/
|
||||
TypeMirror get upperBound;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [TypedefMirror] represents a typedef in a Dart language program.
|
||||
*/
|
||||
abstract class TypedefMirror implements ClassMirror {
|
||||
/**
|
||||
* The defining type for this typedef.
|
||||
*
|
||||
* For instance [:void f(int):] is the value for [:typedef void f(int):].
|
||||
*/
|
||||
TypeMirror get value;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [MethodMirror] reflects a Dart language function, method,
|
||||
* constructor, getter, or setter.
|
||||
*/
|
||||
abstract class MethodMirror implements DeclarationMirror {
|
||||
/**
|
||||
* A mirror on the return type for the reflectee.
|
||||
*/
|
||||
TypeMirror get returnType;
|
||||
|
||||
/**
|
||||
* A list of mirrors on the parameters for the reflectee.
|
||||
*/
|
||||
List<ParameterMirror> get parameters;
|
||||
|
||||
/**
|
||||
* Is the reflectee static?
|
||||
*
|
||||
* For the purposes of the mirrors library, a top-level function is
|
||||
* considered static.
|
||||
*/
|
||||
bool get isStatic;
|
||||
|
||||
/**
|
||||
* Is the reflectee abstract?
|
||||
*/
|
||||
bool get isAbstract;
|
||||
|
||||
/**
|
||||
* Is the reflectee a regular function or method?
|
||||
*
|
||||
* A function or method is regular if it is not a getter, setter, or
|
||||
* constructor. Note that operators, by this definition, are
|
||||
* regular methods.
|
||||
*/
|
||||
bool get isRegularMethod;
|
||||
|
||||
/**
|
||||
* Is the reflectee an operator?
|
||||
*/
|
||||
bool get isOperator;
|
||||
|
||||
/**
|
||||
* Is the reflectee a getter?
|
||||
*/
|
||||
bool get isGetter;
|
||||
|
||||
/**
|
||||
* Is the reflectee a setter?
|
||||
*/
|
||||
bool get isSetter;
|
||||
|
||||
/**
|
||||
* Is the reflectee a constructor?
|
||||
*/
|
||||
bool get isConstructor;
|
||||
|
||||
/**
|
||||
* The constructor name for named constructors and factory methods.
|
||||
*
|
||||
* For unnamed constructors, this is the empty string. For
|
||||
* non-constructors, this is the empty string.
|
||||
*
|
||||
* For example, [:'bar':] is the constructor name for constructor
|
||||
* [:Foo.bar:] of type [:Foo:].
|
||||
*/
|
||||
String get constructorName;
|
||||
|
||||
/**
|
||||
* Is the reflectee a const constructor?
|
||||
*/
|
||||
bool get isConstConstructor;
|
||||
|
||||
/**
|
||||
* Is the reflectee a generative constructor?
|
||||
*/
|
||||
bool get isGenerativeConstructor;
|
||||
|
||||
/**
|
||||
* Is the reflectee a redirecting constructor?
|
||||
*/
|
||||
bool get isRedirectingConstructor;
|
||||
|
||||
/**
|
||||
* Is the reflectee a factory constructor?
|
||||
*/
|
||||
bool get isFactoryConstructor;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [VariableMirror] reflects a Dart language variable declaration.
|
||||
*/
|
||||
abstract class VariableMirror implements DeclarationMirror {
|
||||
/**
|
||||
* A mirror on the type of the reflectee.
|
||||
*/
|
||||
TypeMirror get type;
|
||||
|
||||
/**
|
||||
* Is the reflectee a static variable?
|
||||
*
|
||||
* For the purposes of the mirror library, top-level variables are
|
||||
* implicitly declared static.
|
||||
*/
|
||||
bool get isStatic;
|
||||
|
||||
/**
|
||||
* Is the reflectee a final variable?
|
||||
*/
|
||||
bool get isFinal;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [ParameterMirror] reflects a Dart formal parameter declaration.
|
||||
*/
|
||||
abstract class ParameterMirror implements VariableMirror {
|
||||
/**
|
||||
* A mirror on the type of this parameter.
|
||||
*/
|
||||
TypeMirror get type;
|
||||
|
||||
/**
|
||||
* Is this parameter optional?
|
||||
*/
|
||||
bool get isOptional;
|
||||
|
||||
/**
|
||||
* Is this parameter named?
|
||||
*/
|
||||
bool get isNamed;
|
||||
|
||||
/**
|
||||
* Does this parameter have a default value?
|
||||
*/
|
||||
bool get hasDefaultValue;
|
||||
|
||||
/**
|
||||
* A mirror on the default value for this parameter, if it exists.
|
||||
*
|
||||
* TODO(turnidge): String may not be a good representation of this
|
||||
* at runtime.
|
||||
*/
|
||||
String get defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* A [SourceLocation] describes the span of an entity in Dart source code.
|
||||
*/
|
||||
abstract class SourceLocation {
|
||||
}
|
||||
|
||||
/**
|
||||
* When an error occurs during the mirrored execution of code, a
|
||||
* [MirroredError] is thrown.
|
||||
*
|
||||
* In general, there are three main classes of failure that can happen
|
||||
* during mirrored execution of code in some isolate:
|
||||
*
|
||||
* - An exception is thrown but not caught. This is caught by the
|
||||
* mirrors framework and a [MirroredUncaughtExceptionError] is
|
||||
* created and thrown.
|
||||
*
|
||||
* - A compile-time error occurs, such as a syntax error. This is
|
||||
* suppressed by the mirrors framework and a
|
||||
* [MirroredCompilationError] is created and thrown.
|
||||
*
|
||||
* - A truly fatal error occurs, causing the isolate to be exited. If
|
||||
* the reflector and reflectee share the same isolate, then they
|
||||
* will both suffer. If the reflector and reflectee are in distinct
|
||||
* isolates, then we hope to provide some information about the
|
||||
* isolate death, but this has yet to be implemented.
|
||||
*
|
||||
* TODO(turnidge): Specify the behavior for remote fatal errors.
|
||||
*/
|
||||
abstract class MirroredError implements Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* When an uncaught exception occurs during the mirrored execution
|
||||
* of code, a [MirroredUncaughtExceptionError] is thrown.
|
||||
*
|
||||
* This exception contains a mirror on the original exception object.
|
||||
* It also contains an object which can be used to recover the
|
||||
* stacktrace.
|
||||
*/
|
||||
class MirroredUncaughtExceptionError extends MirroredError {
|
||||
MirroredUncaughtExceptionError(this.exception_mirror,
|
||||
this.exception_string,
|
||||
this.stacktrace) {}
|
||||
|
||||
/** A mirror on the exception object. */
|
||||
final InstanceMirror exception_mirror;
|
||||
|
||||
/** The result of toString() for the exception object. */
|
||||
final String exception_string;
|
||||
|
||||
/** A stacktrace object for the uncaught exception. */
|
||||
final Object stacktrace;
|
||||
|
||||
String toString() {
|
||||
return
|
||||
"Uncaught exception during mirrored execution: <${exception_string}>";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When a compile-time error occurs during the mirrored execution
|
||||
* of code, a [MirroredCompilationError] is thrown.
|
||||
*
|
||||
* This exception includes the compile-time error message that would
|
||||
* have been displayed to the user, if the function had not been
|
||||
* invoked via mirror.
|
||||
*/
|
||||
class MirroredCompilationError extends MirroredError {
|
||||
MirroredCompilationError(this.message) {}
|
||||
|
||||
final String message;
|
||||
|
||||
String toString() {
|
||||
return "Compile-time error during mirrored execution: <$message>";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A [MirrorException] is used to indicate errors within the mirrors
|
||||
* framework.
|
||||
*/
|
||||
class MirrorException implements Exception {
|
||||
const MirrorException(String this._message);
|
||||
String toString() => "MirrorException: '$_message'";
|
||||
final String _message;
|
||||
}
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.scalarlist;
|
||||
|
||||
/**
|
||||
* A random-access sequence of bytes that also provides random access to
|
||||
* the fixed-width integers and floating point numbers represented by
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
* This library allows you to work with arrays of scalar values
|
||||
* of various sizes.
|
||||
*/
|
||||
library dart.scalarlist;
|
||||
#library('dart:scalarlist');
|
||||
|
||||
// TODO(ager): Inline the contents of byte_arrays.dart here and get
|
||||
// rid of scalarlist_sources.gypi when the VM understands normal
|
||||
// library structure for builtin libraries.
|
||||
part 'byte_arrays.dart';
|
||||
#source('byte_arrays.dart');
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
part of dart.uri;
|
||||
|
||||
/**
|
||||
* Javascript-like URI encode/decode functions.
|
||||
* The documentation here borrows heavily from the original Javascript
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue