Version 1.4.0-dev.6.6
svn merge -c 35961 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 36123 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 36124 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 36135 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
git-svn-id: http://dart.googlecode.com/svn/trunk@36146 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/pkg/analyzer/bin/analyzer.dart b/pkg/analyzer/bin/analyzer.dart
index a9333c0..bab77b6 100644
--- a/pkg/analyzer/bin/analyzer.dart
+++ b/pkg/analyzer/bin/analyzer.dart
@@ -70,7 +70,14 @@
if (async) {
return analyzer.analyzeAsync();
} else {
- return analyzer.analyzeSync();
+ var errorSeverity = analyzer.analyzeSync();
+ if (errorSeverity == ErrorSeverity.ERROR) {
+ exitCode = errorSeverity.ordinal;
+ }
+ if (options.warningsAreFatal && errorSeverity == ErrorSeverity.WARNING) {
+ exitCode = errorSeverity.ordinal;
+ }
+ return errorSeverity;
}
}
diff --git a/pkg/web_components/lib/dart_support.js b/pkg/web_components/lib/dart_support.js
index 44b5a38c..503faee 100644
--- a/pkg/web_components/lib/dart_support.js
+++ b/pkg/web_components/lib/dart_support.js
@@ -15,11 +15,18 @@
var needsConstructorFix = window.constructor === window.Window;
// TODO(jmesserly): we need to wrap document somehow (a dart:html hook?)
- window.dartExperimentalFixupGetTag = function(originalGetTag) {
+
+ // dartNativeDispatchHooksTransformer is described on initHooks() in
+ // sdk/lib/_internal/lib/native_helper.dart.
+ if (typeof window.dartNativeDispatchHooksTransformer == 'undefined')
+ window.dartNativeDispatchHooksTransformer = [];
+
+ window.dartNativeDispatchHooksTransformer.push(function(hooks) {
var NodeList = ShadowDOMPolyfill.wrappers.NodeList;
var ShadowRoot = ShadowDOMPolyfill.wrappers.ShadowRoot;
var unwrapIfNeeded = ShadowDOMPolyfill.unwrapIfNeeded;
- function getTag(obj) {
+ var originalGetTag = hooks.getTag;
+ hooks.getTag = function getTag(obj) {
// TODO(jmesserly): do we still need these?
if (obj instanceof NodeList) return 'NodeList';
if (obj instanceof ShadowRoot) return 'ShadowRoot';
@@ -44,8 +51,7 @@
if (ctor === unwrapped.constructor) {
var name = ctor._ShadowDOMPolyfill$cacheTag_;
if (!name) {
- name = Object.prototype.toString.call(unwrapped);
- name = name.substring(8, name.length - 1);
+ name = originalGetTag(unwrapped);
ctor._ShadowDOMPolyfill$cacheTag_ = name;
}
return name;
@@ -55,7 +61,5 @@
}
return originalGetTag(obj);
}
-
- return getTag;
- };
+ });
})();
diff --git a/sdk/lib/_internal/lib/native_helper.dart b/sdk/lib/_internal/lib/native_helper.dart
index 3d7e17b..8f96d07 100644
--- a/sdk/lib/_internal/lib/native_helper.dart
+++ b/sdk/lib/_internal/lib/native_helper.dart
@@ -309,6 +309,7 @@
if (JS('bool', 'typeof window != "undefined"')) {
var context = JS('=Object', 'window');
+ var fun = JS('=Object', 'function () {}');
for (int i = 0; i < tags.length; i++) {
var tag = tags[i];
var proto = prototypeForTagFunction(tag);
@@ -317,6 +318,9 @@
var record = makeDefaultDispatchRecord(tag, interceptorClass, proto);
if (record != null) {
setDispatchProperty(proto, record);
+ // Ensure the modified prototype is still fast by assigning it to
+ // the prototype property of a function object.
+ JS('', '#.prototype = #', fun, proto);
}
}
}
@@ -495,13 +499,23 @@
if (typeof constructor == "function") {
var name = constructor.name;
// If the name is a non-empty string, we use that as the type name of this
- // object. On Firefox, we often get "Object" as the constructor name even
- // for more specialized objects so we have to fall through to the toString()
- // based implementation below in that case.
- if (typeof name == "string"
- && name !== ""
- && name !== "Object"
- && name !== "Function.prototype") { // Can happen in Opera.
+ // object. There are various cases where that does not work, so we have to
+ // detect them and fall through to the toString() based implementation.
+
+ if (typeof name == "string" &&
+
+ // Sometimes the string is empty. This test also catches minified
+ // shadow dom polyfil wrapper for Window on Firefox where the faked
+ // constructor name does not 'stick'. The shortest real DOM object
+ // names have three characters (e.g. URL, CSS).
+ name.length > 2 &&
+
+ // On Firefox we often get "Object" as the constructor name, even for
+ // more specialized DOM objects.
+ name !== "Object" &&
+
+ // This can happen in Opera.
+ name !== "Function.prototype") {
return name;
}
}
diff --git a/tools/VERSION b/tools/VERSION
index 423c53d..637a721 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -28,4 +28,4 @@
MINOR 4
PATCH 0
PRERELEASE 6
-PRERELEASE_PATCH 5
+PRERELEASE_PATCH 6