| 1 |
Description: Reintroduces removed classes and methods to preserve the backward compatibility. |
| 2 |
* Commit 9144b81 renamed isGetter/Setter methods, this breaks closure-compiler |
| 3 |
* Commit 71468c9 removed deprecated exceptions still used by htmlunit/2.8-2 |
| 4 |
Author: Emmanuel Bourg <[email protected]> |
| 5 |
Forwarded: not-needed |
| 6 |
--- a/src/org/mozilla/javascript/ast/ObjectProperty.java |
| 7 |
+++ b/src/org/mozilla/javascript/ast/ObjectProperty.java |
| 8 |
@@ -69,6 +69,10 @@ |
| 9 |
type = Token.GET; |
| 10 |
} |
| 11 |
|
| 12 |
+ public void setIsGetter() { |
| 13 |
+ setIsGetterMethod(); |
| 14 |
+ } |
| 15 |
+ |
| 16 |
/** |
| 17 |
* Returns true if this is a getter function. |
| 18 |
*/ |
| 19 |
@@ -76,6 +80,10 @@ |
| 20 |
return type == Token.GET; |
| 21 |
} |
| 22 |
|
| 23 |
+ public boolean isGetter() { |
| 24 |
+ return isGetterMethod(); |
| 25 |
+ } |
| 26 |
+ |
| 27 |
/** |
| 28 |
* Marks this node as a "setter" property. |
| 29 |
*/ |
| 30 |
@@ -83,6 +91,10 @@ |
| 31 |
type = Token.SET; |
| 32 |
} |
| 33 |
|
| 34 |
+ public void setIsSetter() { |
| 35 |
+ setIsSetterMethod(); |
| 36 |
+ } |
| 37 |
+ |
| 38 |
/** |
| 39 |
* Returns true if this is a setter function. |
| 40 |
*/ |
| 41 |
@@ -90,6 +102,10 @@ |
| 42 |
return type == Token.SET; |
| 43 |
} |
| 44 |
|
| 45 |
+ public boolean isSetter() { |
| 46 |
+ return isSetterMethod(); |
| 47 |
+ } |
| 48 |
+ |
| 49 |
public void setIsNormalMethod() { |
| 50 |
type = Token.METHOD; |
| 51 |
} |
| 52 |
--- a/src/org/mozilla/javascript/ast/FunctionNode.java |
| 53 |
+++ b/src/org/mozilla/javascript/ast/FunctionNode.java |
| 54 |
@@ -330,14 +330,26 @@ |
| 55 |
return functionForm == Form.GETTER || functionForm == Form.SETTER || functionForm == Form.METHOD; |
| 56 |
} |
| 57 |
|
| 58 |
+ public boolean isGetterOrSetter() { |
| 59 |
+ return functionForm == Form.GETTER || functionForm == Form.SETTER; |
| 60 |
+ } |
| 61 |
+ |
| 62 |
public boolean isGetterMethod() { |
| 63 |
return functionForm == Form.GETTER; |
| 64 |
} |
| 65 |
|
| 66 |
+ public boolean isGetter() { |
| 67 |
+ return isGetterMethod(); |
| 68 |
+ } |
| 69 |
+ |
| 70 |
public boolean isSetterMethod() { |
| 71 |
return functionForm == Form.SETTER; |
| 72 |
} |
| 73 |
|
| 74 |
+ public boolean isSetter() { |
| 75 |
+ return isSetterMethod(); |
| 76 |
+ } |
| 77 |
+ |
| 78 |
public boolean isNormalMethod() { |
| 79 |
return functionForm == Form.METHOD; |
| 80 |
} |
| 81 |
@@ -346,10 +358,18 @@ |
| 82 |
functionForm = Form.GETTER; |
| 83 |
} |
| 84 |
|
| 85 |
+ public void setFunctionIsGetter() { |
| 86 |
+ setFunctionIsGetterMethod(); |
| 87 |
+ } |
| 88 |
+ |
| 89 |
public void setFunctionIsSetterMethod() { |
| 90 |
functionForm = Form.SETTER; |
| 91 |
} |
| 92 |
|
| 93 |
+ public void setFunctionIsSetter() { |
| 94 |
+ setFunctionIsSetterMethod(); |
| 95 |
+ } |
| 96 |
+ |
| 97 |
public void setFunctionIsNormalMethod() { |
| 98 |
functionForm = Form.METHOD; |
| 99 |
} |
| 100 |
--- /dev/null |
| 101 |
+++ b/src/org/mozilla/javascript/ClassDefinitionException.java |
| 102 |
@@ -0,0 +1,22 @@ |
| 103 |
+ |
| 104 |
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 105 |
+ * |
| 106 |
+ * This Source Code Form is subject to the terms of the Mozilla Public |
| 107 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 108 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 109 |
+// API class |
| 110 |
+ |
| 111 |
+package org.mozilla.javascript; |
| 112 |
+ |
| 113 |
+/** |
| 114 |
+ * @deprecated The exception is no longer thrown by Rhino runtime as |
| 115 |
+ * {@link EvaluatorException} is used instead. |
| 116 |
+ */ |
| 117 |
+public class ClassDefinitionException extends RuntimeException |
| 118 |
+{ |
| 119 |
+ static final long serialVersionUID = -5637830967241712746L; |
| 120 |
+ |
| 121 |
+ public ClassDefinitionException(String detail) { |
| 122 |
+ super(detail); |
| 123 |
+ } |
| 124 |
+} |
| 125 |
--- /dev/null |
| 126 |
+++ b/src/org/mozilla/javascript/NotAFunctionException.java |
| 127 |
@@ -0,0 +1,20 @@ |
| 128 |
+ |
| 129 |
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 130 |
+ * |
| 131 |
+ * This Source Code Form is subject to the terms of the Mozilla Public |
| 132 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 133 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 134 |
+// API class |
| 135 |
+ |
| 136 |
+package org.mozilla.javascript; |
| 137 |
+ |
| 138 |
+/** |
| 139 |
+ * @deprecated The exception is no longer thrown by Rhino runtime as |
| 140 |
+ * {@link EvaluatorException} is used instead. |
| 141 |
+ */ |
| 142 |
+public class NotAFunctionException extends RuntimeException |
| 143 |
+{ |
| 144 |
+ static final long serialVersionUID = 6461524852170711724L; |
| 145 |
+ |
| 146 |
+ public NotAFunctionException() { } |
| 147 |
+} |
| 148 |
--- /dev/null |
| 149 |
+++ b/src/org/mozilla/javascript/PropertyException.java |
| 150 |
@@ -0,0 +1,22 @@ |
| 151 |
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 152 |
+ * |
| 153 |
+ * This Source Code Form is subject to the terms of the Mozilla Public |
| 154 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 155 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 156 |
+ |
| 157 |
+// API class |
| 158 |
+ |
| 159 |
+package org.mozilla.javascript; |
| 160 |
+ |
| 161 |
+/** |
| 162 |
+ * @deprecated This exception is no longer thrown by Rhino runtime. |
| 163 |
+ */ |
| 164 |
+public class PropertyException extends RuntimeException |
| 165 |
+{ |
| 166 |
+ static final long serialVersionUID = -8221564865490676219L; |
| 167 |
+ |
| 168 |
+ public PropertyException(String detail) { |
| 169 |
+ super(detail); |
| 170 |
+ } |
| 171 |
+ |
| 172 |
+} |