Revert "Move dart:web to pkg:htmlescape."
This reverts r11943. R=lrn@google.com BUG= Review URL: https://chromiumcodereview.appspot.com//10912123 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11945 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
@@ -75,6 +75,9 @@ const Map<String, LibraryInfo> LIBRARIES = const <LibraryInfo> {
|
||||
"utf": const LibraryInfo(
|
||||
"utf/utf.dart"),
|
||||
|
||||
"web": const LibraryInfo(
|
||||
"web/web.dart"),
|
||||
|
||||
"_js_helper": const LibraryInfo(
|
||||
"compiler/implementation/lib/js_helper.dart",
|
||||
category: "Internal",
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
// 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.
|
||||
|
||||
/**
|
||||
* This library contains functions to escape strings for safe inclusion
|
||||
* in HTML source.
|
||||
*/
|
||||
#library("htmlescape");
|
||||
#library("dart:web");
|
||||
|
||||
// Web related functions and data that are not specific to a single environment
|
||||
// (e.g., only in a browser or only on a server).
|
||||
|
||||
/**
|
||||
* Escapes HTML-special characters of [text] so that the result can be
|
||||
@@ -1,8 +0,0 @@
|
||||
name: htmlescape
|
||||
description: >
|
||||
Simple HTML utility for escapeing a String.
|
||||
|
||||
|
||||
dependencies:
|
||||
unittest:
|
||||
sdk: unittest
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#library('intl');
|
||||
|
||||
#import('../../pkg/htmlescape/htmlescape.dart');
|
||||
#import('dart:web');
|
||||
|
||||
#import('date_format.dart');
|
||||
#source('intl_message.dart');
|
||||
|
||||
@@ -6,5 +6,3 @@ description: >
|
||||
dependencies:
|
||||
unittest:
|
||||
sdk: unittest
|
||||
htmlescape
|
||||
sdk: htmlescape
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
'json_cc_file': '<(SHARED_INTERMEDIATE_DIR)/json_gen.cc',
|
||||
'uri_cc_file': '<(SHARED_INTERMEDIATE_DIR)/uri_gen.cc',
|
||||
'utf_cc_file': '<(SHARED_INTERMEDIATE_DIR)/utf_gen.cc',
|
||||
'web_cc_file': '<(SHARED_INTERMEDIATE_DIR)/web_gen.cc',
|
||||
'builtin_in_cc_file': 'builtin_in.cc',
|
||||
'builtin_cc_file': '<(SHARED_INTERMEDIATE_DIR)/builtin_gen.cc',
|
||||
'snapshot_in_cc_file': 'snapshot_in.cc',
|
||||
@@ -215,6 +216,36 @@
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
'target_name': 'generate_web_cc_file',
|
||||
'type': 'none',
|
||||
'includes': [
|
||||
'web_sources.gypi',
|
||||
],
|
||||
'actions': [
|
||||
{
|
||||
'action_name': 'generate_web_cc',
|
||||
'inputs': [
|
||||
'../tools/create_string_literal.py',
|
||||
'<(builtin_in_cc_file)',
|
||||
'<@(_sources)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(web_cc_file)',
|
||||
],
|
||||
'action': [
|
||||
'python',
|
||||
'tools/create_string_literal.py',
|
||||
'--output', '<(web_cc_file)',
|
||||
'--input_cc', '<(builtin_in_cc_file)',
|
||||
'--include', 'bin/builtin.h',
|
||||
'--var_name', 'Builtin::web_source_',
|
||||
'<@(_sources)',
|
||||
],
|
||||
'message': 'Generating ''<(web_cc_file)'' file.'
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
'target_name': 'libdart_builtin',
|
||||
'type': 'static_library',
|
||||
@@ -225,6 +256,7 @@
|
||||
'generate_json_cc_file',
|
||||
'generate_uri_cc_file',
|
||||
'generate_utf_cc_file',
|
||||
'generate_web_cc_file',
|
||||
],
|
||||
'include_dirs': [
|
||||
'..',
|
||||
@@ -307,6 +339,7 @@
|
||||
'<(json_cc_file)',
|
||||
'<(uri_cc_file)',
|
||||
'<(utf_cc_file)',
|
||||
'<(web_cc_file)',
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
@@ -389,6 +422,7 @@
|
||||
'main.cc',
|
||||
'builtin_nolib.cc',
|
||||
'<(snapshot_cc_file)',
|
||||
'<(web_cc_file)',
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
@@ -426,6 +460,7 @@
|
||||
'<(json_cc_file)',
|
||||
'<(uri_cc_file)',
|
||||
'<(utf_cc_file)',
|
||||
'<(web_cc_file)',
|
||||
'snapshot_empty.cc',
|
||||
],
|
||||
'conditions': [
|
||||
@@ -464,6 +499,7 @@
|
||||
'<(json_cc_file)',
|
||||
'<(uri_cc_file)',
|
||||
'<(utf_cc_file)',
|
||||
'<(web_cc_file)',
|
||||
],
|
||||
'includes': [
|
||||
'builtin_impl_sources.gypi',
|
||||
|
||||
@@ -17,7 +17,8 @@ Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
|
||||
{ DartUtils::kUriLibURL, uri_source_, false },
|
||||
{ DartUtils::kCryptoLibURL, crypto_source_, false },
|
||||
{ DartUtils::kIOLibURL, io_source_, true },
|
||||
{ DartUtils::kUtfLibURL, utf_source_, false }
|
||||
{ DartUtils::kUtfLibURL, utf_source_, false },
|
||||
{ DartUtils::kWebLibURL, web_source_, false }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class Builtin {
|
||||
kCryptoLibrary,
|
||||
kIOLibrary,
|
||||
kUtfLibrary,
|
||||
kWebLibrary,
|
||||
|
||||
kInvalidLibrary,
|
||||
};
|
||||
|
||||
@@ -17,14 +17,16 @@ Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
|
||||
{ DartUtils::kUriLibURL, NULL, false },
|
||||
{ DartUtils::kCryptoLibURL, NULL, false },
|
||||
{ DartUtils::kIOLibURL, NULL, true },
|
||||
{ DartUtils::kUtfLibURL, NULL, false }
|
||||
{ DartUtils::kUtfLibURL, NULL, false },
|
||||
{ DartUtils::kWebLibURL, web_source_, false }
|
||||
};
|
||||
|
||||
|
||||
Dart_Handle Builtin::Source(BuiltinLibraryId id) {
|
||||
ASSERT((sizeof(builtin_libraries_) / sizeof(builtin_lib_props)) ==
|
||||
kInvalidLibrary);
|
||||
return Dart_NewApiError("Unreachable code in Builtin::Source (%d).", id);
|
||||
ASSERT(id == kWebLibrary);
|
||||
return Dart_NewString(builtin_libraries_[id].source_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ const char* DartUtils::kJsonLibURL = "dart:json";
|
||||
const char* DartUtils::kUriLibURL = "dart:uri";
|
||||
const char* DartUtils::kUtfLibURL = "dart:utf";
|
||||
const char* DartUtils::kIsolateLibURL = "dart:isolate";
|
||||
const char* DartUtils::kWebLibURL = "dart:web";
|
||||
|
||||
|
||||
const char* DartUtils::kIdFieldName = "_id";
|
||||
@@ -165,6 +166,11 @@ bool DartUtils::IsDartUtfLibURL(const char* url_name) {
|
||||
}
|
||||
|
||||
|
||||
bool DartUtils::IsDartWebLibURL(const char* url_name) {
|
||||
return (strcmp(url_name, kWebLibURL) == 0);
|
||||
}
|
||||
|
||||
|
||||
Dart_Handle DartUtils::CanonicalizeURL(CommandLineOptions* url_mapping,
|
||||
Dart_Handle library,
|
||||
const char* url_str) {
|
||||
@@ -300,6 +306,8 @@ Dart_Handle DartUtils::LibraryTagHandler(Dart_LibraryTag tag,
|
||||
id = Builtin::kUriLibrary;
|
||||
} else if (DartUtils::IsDartUtfLibURL(url_string)) {
|
||||
id = Builtin::kUtfLibrary;
|
||||
} else if (DartUtils::IsDartWebLibURL(url_string)) {
|
||||
id = Builtin::kWebLibrary;
|
||||
} else {
|
||||
return Dart_Error("Do not know how to load '%s'", url_string);
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ class DartUtils {
|
||||
static bool IsDartJsonLibURL(const char* url_name);
|
||||
static bool IsDartUriLibURL(const char* url_name);
|
||||
static bool IsDartUtfLibURL(const char* url_name);
|
||||
static bool IsDartWebLibURL(const char* url_name);
|
||||
static Dart_Handle CanonicalizeURL(CommandLineOptions* url_mapping,
|
||||
Dart_Handle library,
|
||||
const char* url_str);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# 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.
|
||||
|
||||
# This file contains all sources for the dart:web library.
|
||||
{
|
||||
'sources': [
|
||||
'../../lib/web/web.dart',
|
||||
],
|
||||
}
|
||||
@@ -86,6 +86,8 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
|
||||
return Builtin::LoadAndCheckLibrary(Builtin::kUtfLibrary);
|
||||
} else if (DartUtils::IsDartCryptoLibURL(url_chars)) {
|
||||
return Builtin::LoadAndCheckLibrary(Builtin::kCryptoLibrary);
|
||||
} else if (DartUtils::IsDartWebLibURL(url_chars)) {
|
||||
return Builtin::LoadAndCheckLibrary(Builtin::kWebLibrary);
|
||||
} else {
|
||||
return Dart_Error("Do not know how to load '%s'", url_chars);
|
||||
}
|
||||
|
||||
+4
-4
@@ -55,10 +55,11 @@
|
||||
# ......uri/
|
||||
# ........uri.dart
|
||||
# ......utf/
|
||||
# ......web/
|
||||
# ........web.dart
|
||||
# ....pkg/
|
||||
# ......args/
|
||||
# ......dartdoc/
|
||||
#.......htmlescape/
|
||||
# ......intl/
|
||||
# ......logging/
|
||||
# ......(more will come here)
|
||||
@@ -299,9 +300,8 @@ def Main(argv):
|
||||
# Create and populate lib/{core, crypto, isolate, json, uri, utf, ...}.
|
||||
#
|
||||
|
||||
# TODO: Take this data from lib/_internal/libraries.dart!
|
||||
for library in ['_internal', 'core', 'coreimpl', 'crypto', 'isolate', 'json',
|
||||
'math', 'mirrors', 'uri', 'utf']:
|
||||
'math', 'mirrors', 'uri', 'utf', 'web']:
|
||||
src_dir = join(HOME, 'lib', library)
|
||||
dest_dir = join(LIB, library)
|
||||
os.makedirs(dest_dir)
|
||||
@@ -318,7 +318,7 @@ def Main(argv):
|
||||
# Create and populate pkg/{args, intl, logging, unittest}
|
||||
#
|
||||
|
||||
for library in ['args', 'htmlescape', 'intl', 'logging', 'unittest']:
|
||||
for library in ['args', 'intl', 'logging', 'unittest']:
|
||||
src_dir = join(HOME, 'pkg', library)
|
||||
dest_dir = join(PKG, library)
|
||||
os.makedirs(dest_dir)
|
||||
|
||||
Reference in New Issue
Block a user