Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 # Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 define INFINITY = (1/0); | 171 define INFINITY = (1/0); |
| 172 define UNDEFINED = (void 0); | 172 define UNDEFINED = (void 0); |
| 173 | 173 |
| 174 # Macros implemented in Python. | 174 # Macros implemented in Python. |
| 175 python macro CHAR_CODE(str) = ord(str[1]); | 175 python macro CHAR_CODE(str) = ord(str[1]); |
| 176 | 176 |
| 177 # Constants used on an array to implement the properties of the RegExp object. | 177 # Constants used on an array to implement the properties of the RegExp object. |
| 178 define REGEXP_NUMBER_OF_CAPTURES = 0; | 178 define REGEXP_NUMBER_OF_CAPTURES = 0; |
| 179 define REGEXP_FIRST_CAPTURE = 3; | 179 define REGEXP_FIRST_CAPTURE = 3; |
| 180 | 180 |
| 181 macro REGEXP_GLOBAL(regexp) = (regexp[regExpFlagsSymbol] & 1); | |
|
Dan Ehrenberg
2015/11/02 19:21:06
Can you define constants for these numbers like 1,
Yang
2015/11/02 20:51:08
Isnt the point of macros.py to contain those const
| |
| 182 macro REGEXP_IGNORE_CASE(regexp) = (regexp[regExpFlagsSymbol] & 2); | |
| 183 macro REGEXP_MULTILINE(regexp) = (regexp[regExpFlagsSymbol] & 4); | |
| 184 macro REGEXP_STICKY(regexp) = (regexp[regExpFlagsSymbol] & 8); | |
| 185 macro REGEXP_UNICODE(regexp) = (regexp[regExpFlagsSymbol] & 16); | |
| 186 macro REGEXP_SOURCE(regexp) = (regexp[regExpSourceSymbol]); | |
| 187 | |
| 181 # We can't put macros in macros so we use constants here. | 188 # We can't put macros in macros so we use constants here. |
| 182 # REGEXP_NUMBER_OF_CAPTURES | 189 # REGEXP_NUMBER_OF_CAPTURES |
| 183 macro NUMBER_OF_CAPTURES(array) = ((array)[0]); | 190 macro NUMBER_OF_CAPTURES(array) = ((array)[0]); |
| 184 | 191 |
| 185 # Limit according to ECMA 262 15.9.1.1 | 192 # Limit according to ECMA 262 15.9.1.1 |
| 186 define MAX_TIME_MS = 8640000000000000; | 193 define MAX_TIME_MS = 8640000000000000; |
| 187 # Limit which is MAX_TIME_MS + msPerMonth. | 194 # Limit which is MAX_TIME_MS + msPerMonth. |
| 188 define MAX_TIME_BEFORE_UTC = 8640002592000000; | 195 define MAX_TIME_BEFORE_UTC = 8640002592000000; |
| 189 | 196 |
| 190 # Gets the value of a Date object. If arg is not a Date object | 197 # Gets the value of a Date object. If arg is not a Date object |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 define NOT_FOUND = -1; | 309 define NOT_FOUND = -1; |
| 303 | 310 |
| 304 # Check whether debug is active. | 311 # Check whether debug is active. |
| 305 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); | 312 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); |
| 306 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); | 313 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); |
| 307 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (%_DebugIsActive() != 0) %DebugPrepareStepInIfStepping(function); | 314 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (%_DebugIsActive() != 0) %DebugPrepareStepInIfStepping(function); |
| 308 | 315 |
| 309 # SharedFlag equivalents | 316 # SharedFlag equivalents |
| 310 define kNotShared = false; | 317 define kNotShared = false; |
| 311 define kShared = true; | 318 define kShared = true; |
| OLD | NEW |