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

Side by Side Diff: compiler/java/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.java

Issue 9479013: Remove backends. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More clean up Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011, 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 package com.google.dart.compiler.backend.js.ast;
6
7 import java.util.ArrayList;
8 import java.util.List;
9
10 /**
11 * A JavaScript object literal.
12 */
13 public final class JsObjectLiteral extends JsLiteral {
14
15 private final List<JsPropertyInitializer> props = new ArrayList<JsPropertyInit ializer>();
16
17 public JsObjectLiteral() {
18 }
19
20 public List<JsPropertyInitializer> getPropertyInitializers() {
21 return props;
22 }
23
24 @Override
25 public boolean hasSideEffects() {
26 for (JsPropertyInitializer prop : props) {
27 if (prop.hasSideEffects()) {
28 return true;
29 }
30 }
31 return false;
32 }
33
34 @Override
35 public boolean isBooleanFalse() {
36 return false;
37 }
38
39 @Override
40 public boolean isBooleanTrue() {
41 return true;
42 }
43
44 @Override
45 public boolean isDefinitelyNotNull() {
46 return true;
47 }
48
49 @Override
50 public boolean isDefinitelyNull() {
51 return false;
52 }
53
54 @Override
55 public void traverse(JsVisitor v, JsContext ctx) {
56 if (v.visit(this, ctx)) {
57 v.acceptWithInsertRemove(props);
58 }
59 v.endVisit(this, ctx);
60 }
61
62 @Override
63 public NodeKind getKind() {
64 return NodeKind.OBJECT;
65 }
66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698