Skip to content

Commit b9c83e0

Browse files
committed
Most of this CL just re-organizes the runtime code into multiple sub-libraries. js_utils and loader remain as top level symbols (the former so that it has no dependencies, the latter since it defines the module system that the rest use).
The dart runtime files are roughly split around functional boundaries. Comments at the top of each file describe the function of the library. I'm not sure that these are 100% right yet, but they're closer. We may want to iterate on the organization. The main dart runtime file just re-exports various symbols from the sub-libraries. It has hard dependencies on the other runtime files, some of which have soft (lazy) dependencies on SDK files. The generated code now depends on dart and dartx as a imported libraries, rather than as top level symbols. This CL also includes some new code to make type representations a bit better. This is mostly in the new types.js file, which makes all of the non-instance types (dynamic, bottom, void, function types) subtypes of a common representation type. Among other things, they now have the correct runtime type (core.Type). Some of the type code has been rationalized around this a bit, but there is more left to do here. The setSignature code in classes.js now also places the correct runtime type on nominal (instance) types. There are new tests in the runtime_tests.js file to test for this. The static object method code that implements the Object methods has not yet been updated to dispatch on type representations. I will do that in a separate CL. BUG= [email protected], [email protected] Review URL: https://codereview.chromium.org/1182653002
1 parent cad6ec1 commit b9c83e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2020
-1554
lines changed

pkg/dev_compiler/lib/runtime/_classes.js

Lines changed: 412 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
/*
6+
* This library encapsulates the core sdk errors that the runtime knows about.
7+
*
8+
*/
9+
10+
dart_library.library('dart_runtime/_errors', null, /* Imports */[
11+
], /* Lazy Imports */[
12+
'dart/core',
13+
'dart/_js_helper'
14+
], function(exports, core, _js_helper) {
15+
'use strict';
16+
17+
function throwNoSuchMethod(obj, name, pArgs, nArgs, extras) {
18+
throw new core.NoSuchMethodError(obj, name, pArgs, nArgs, extras);
19+
}
20+
exports.throwNoSuchMethod = throwNoSuchMethod;
21+
22+
function throwCastError(actual, type) {
23+
throw new _js_helper.CastErrorImplementation(actual, type);
24+
}
25+
exports.throwCastError = throwCastError;
26+
27+
function throwAssertionError() {
28+
throw new core.AssertionError();
29+
}
30+
exports.throwAssertionError = throwAssertionError;
31+
});

0 commit comments

Comments
 (0)