| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 %FunctionSetLength($RegExp.prototype.compile, 1); | 311 %FunctionSetLength($RegExp.prototype.compile, 1); |
| 312 | 312 |
| 313 // The properties input, $input, and $_ are aliases for each other. When this | 313 // The properties input, $input, and $_ are aliases for each other. When this |
| 314 // value is set the value it is set to is coerced to a string. | 314 // value is set the value it is set to is coerced to a string. |
| 315 // Getter and setter for the input. | 315 // Getter and setter for the input. |
| 316 function RegExpGetInput() { | 316 function RegExpGetInput() { |
| 317 var regExpInput = LAST_INPUT(lastMatchInfo); | 317 var regExpInput = LAST_INPUT(lastMatchInfo); |
| 318 return IS_UNDEFINED(regExpInput) ? "" : regExpInput; | 318 return IS_UNDEFINED(regExpInput) ? "" : regExpInput; |
| 319 } | 319 } |
| 320 function RegExpSetInput(string) { | 320 function RegExpSetInput(string) { |
| 321 lastMatchInfo[lastMatchInfo[REGEXP_NUMBER_OF_CAPTURES] + 2] = string; | 321 lastMatchInfo[lastMatchInfo[REGEXP_NUMBER_OF_CAPTURES] + 2] = |
| 322 ToString(string); |
| 322 }; | 323 }; |
| 323 | 324 |
| 324 %DefineAccessor($RegExp, 'input', GETTER, RegExpGetInput, DONT_DELETE); | 325 %DefineAccessor($RegExp, 'input', GETTER, RegExpGetInput, DONT_DELETE); |
| 325 %DefineAccessor($RegExp, 'input', SETTER, RegExpSetInput, DONT_DELETE); | 326 %DefineAccessor($RegExp, 'input', SETTER, RegExpSetInput, DONT_DELETE); |
| 326 %DefineAccessor($RegExp, '$_', GETTER, RegExpGetInput, DONT_ENUM | DONT_DELETE
); | 327 %DefineAccessor($RegExp, '$_', GETTER, RegExpGetInput, DONT_ENUM | DONT_DELETE
); |
| 327 %DefineAccessor($RegExp, '$_', SETTER, RegExpSetInput, DONT_ENUM | DONT_DELETE
); | 328 %DefineAccessor($RegExp, '$_', SETTER, RegExpSetInput, DONT_ENUM | DONT_DELETE
); |
| 328 %DefineAccessor($RegExp, '$input', GETTER, RegExpGetInput, DONT_ENUM | DONT_DE
LETE); | 329 %DefineAccessor($RegExp, '$input', GETTER, RegExpGetInput, DONT_ENUM | DONT_DE
LETE); |
| 329 %DefineAccessor($RegExp, '$input', SETTER, RegExpSetInput, DONT_ENUM | DONT_DE
LETE); | 330 %DefineAccessor($RegExp, '$input', SETTER, RegExpSetInput, DONT_ENUM | DONT_DE
LETE); |
| 330 | 331 |
| 331 // The properties multiline and $* are aliases for each other. When this | 332 // The properties multiline and $* are aliases for each other. When this |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 %DefineAccessor($RegExp, "$'", SETTER, NoOpSetter, DONT_ENUM | DONT_DELETE); | 369 %DefineAccessor($RegExp, "$'", SETTER, NoOpSetter, DONT_ENUM | DONT_DELETE); |
| 369 | 370 |
| 370 for (var i = 1; i < 10; ++i) { | 371 for (var i = 1; i < 10; ++i) { |
| 371 %DefineAccessor($RegExp, '$' + i, GETTER, RegExpMakeCaptureGetter(i), DONT_D
ELETE); | 372 %DefineAccessor($RegExp, '$' + i, GETTER, RegExpMakeCaptureGetter(i), DONT_D
ELETE); |
| 372 %DefineAccessor($RegExp, '$' + i, SETTER, NoOpSetter, DONT_DELETE); | 373 %DefineAccessor($RegExp, '$' + i, SETTER, NoOpSetter, DONT_DELETE); |
| 373 } | 374 } |
| 374 } | 375 } |
| 375 | 376 |
| 376 | 377 |
| 377 SetupRegExp(); | 378 SetupRegExp(); |
| OLD | NEW |