Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: runtime/vm/parser.cc

Issue 1690903003: Remove support for Javascript warnings in the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 9f5cb49808b0f3689b217992a7ccbe722f5a7fb1..bfd9a170e4bcc1af79c38a21a8d4ab0a9a7b6a73 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -59,8 +59,6 @@ DEFINE_FLAG(bool, await_is_keyword, false,
DECLARE_FLAG(bool, lazy_dispatchers);
DECLARE_FLAG(bool, load_deferred_eagerly);
DECLARE_FLAG(bool, profile_vm);
-DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
-DECLARE_FLAG(bool, warn_on_javascript_compatibility);
// Quick access to the current thread, isolate and zone.
#define T (thread())
@@ -538,14 +536,6 @@ RawInteger* Parser::CurrentIntegerLiteral() const {
literal_token_ ^= tokens_iterator_.CurrentToken();
ASSERT(literal_token_.kind() == Token::kINTEGER);
RawInteger* ri = Integer::RawCast(literal_token_.value());
- if (FLAG_throw_on_javascript_int_overflow) {
- const Integer& i = Integer::Handle(Z, ri);
- if (i.CheckJavascriptIntegerOverflow()) {
- ReportError(TokenPos(),
- "Integer literal does not fit in a Javascript integer: %s.",
- i.ToCString());
- }
- }
return ri;
}
@@ -11116,36 +11106,32 @@ AstNode* Parser::ParseStaticCall(const Class& cls,
(cls.library() == Library::CoreLibrary()) &&
(func.name() == Symbols::Identical().raw())) {
// This is the predefined toplevel function identical(a,b).
- // Create a comparison node instead of a static call to the function, unless
- // javascript warnings are desired and identical is not invoked from a patch
- // source.
- if (!FLAG_warn_on_javascript_compatibility || is_patch_source()) {
- ASSERT(num_arguments == 2);
-
- // If both arguments are constant expressions of type string,
- // evaluate and canonicalize them.
- // This guarantees that identical("ab", "a"+"b") is true.
- // An alternative way to guarantee this would be to introduce
- // an AST node that canonicalizes a value.
- AstNode* arg0 = arguments->NodeAt(0);
- const Instance* val0 = arg0->EvalConstExpr();
- if ((val0 != NULL) && (val0->IsString())) {
- AstNode* arg1 = arguments->NodeAt(1);
- const Instance* val1 = arg1->EvalConstExpr();
- if ((val1 != NULL) && (val1->IsString())) {
- arguments->SetNodeAt(0,
- new(Z) LiteralNode(arg0->token_pos(),
- EvaluateConstExpr(arg0->token_pos(), arg0)));
- arguments->SetNodeAt(1,
- new(Z) LiteralNode(arg1->token_pos(),
- EvaluateConstExpr(arg1->token_pos(), arg1)));
- }
- }
- return new(Z) ComparisonNode(ident_pos,
- Token::kEQ_STRICT,
- arguments->NodeAt(0),
- arguments->NodeAt(1));
- }
+ // Create a comparison node instead of a static call to the function.
+ ASSERT(num_arguments == 2);
+
+ // If both arguments are constant expressions of type string,
+ // evaluate and canonicalize them.
+ // This guarantees that identical("ab", "a"+"b") is true.
+ // An alternative way to guarantee this would be to introduce
+ // an AST node that canonicalizes a value.
+ AstNode* arg0 = arguments->NodeAt(0);
+ const Instance* val0 = arg0->EvalConstExpr();
+ if ((val0 != NULL) && (val0->IsString())) {
+ AstNode* arg1 = arguments->NodeAt(1);
+ const Instance* val1 = arg1->EvalConstExpr();
+ if ((val1 != NULL) && (val1->IsString())) {
+ arguments->SetNodeAt(0,
+ new(Z) LiteralNode(arg0->token_pos(),
+ EvaluateConstExpr(arg0->token_pos(), arg0)));
+ arguments->SetNodeAt(1,
+ new(Z) LiteralNode(arg1->token_pos(),
+ EvaluateConstExpr(arg1->token_pos(), arg1)));
+ }
+ }
+ return new(Z) ComparisonNode(ident_pos,
+ Token::kEQ_STRICT,
+ arguments->NodeAt(0),
+ arguments->NodeAt(1));
}
return new(Z) StaticCallNode(ident_pos, func, arguments);
}
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698