summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/errors
Commit message (Collapse)AuthorAgeFilesLines
* Promote count() warning to TypeErrorGeorge Peter Banyard2020-09-211-4/+4
| | | | Closes GH-6180
* Improve error messages mentioning parameters instead of argumentsMáté Kocsis2020-09-091-1/+1
| | | | Closes GH-5999
* Reindent phpt filesNikita Popov2020-02-031-5/+5
|
* Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* Use %d when expecting line number in testsGabriel Caruso2018-02-021-1/+1
|
* Add tests for invalid count() operationsCraig Duncan2016-11-171-0/+18
|
* Update exception names in tests after formatting changes.Aaron Piotrowski2015-05-173-4/+4
|
* Tweak uncaught exception message displayNikita Popov2015-05-175-6/+6
| | | | | | | | | | | | | This implements a reduced variant of #1226 with just the following change: -Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d +Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d The '' wrapper around messages is very weird if the exception message itself contains ''. Futhermore having the message wrapped in '' doesn't work for the "and defined" suffix of TypeExceptions.
* Display EngineExceptions like ordinary exceptionsNikita Popov2015-05-153-3/+16
| | | | | | | | | TypeException stays as-is for now because it uses messages that are incompatible with the way exception messages are displayed. closure_038.phpt and a few others now show that we're generating too many exceptions for compound operations on undefined properties -- this needs to be fixed in a followup.
* Convert fatal error into EngineExceptionDmitry Stogov2015-04-011-1/+8
|
* Implement Generator::getReturn()Nikita Popov2015-03-172-26/+0
| | | | | Conflicts: Zend/zend_vm_execute.h
* Errors converted to exceptions are not "recoverable" anymore.Dmitry Stogov2015-03-101-1/+1
|
* Wrong expectation in tests (for some reason backtraces contained invlalid ↵Dmitry Stogov2014-07-071-2/+1
| | | | extra frame at the top)
* refixed the test related to bug #67072Anatol Belski2014-04-181-4/+4
|
* Fixed test case for 5328d42Tjerk Meesters2014-04-171-3/+2
|
* Fix tests after laruence unserialize changeNikita Popov2013-03-091-2/+0
|
* Fix segfault when traversing a by-ref generator twiceNikita Popov2012-08-291-1/+6
| | | | | | | | If you try to traverse an already closed generator an exception will now be thrown. Furthermore this changes the error for traversing a by-val generator by-ref from an E_ERROR to an Exception.
* Fix several issues and allow rewind only at/before first yieldNikita Popov2012-08-252-0/+46
| | | | | | | | * Trying to resume a generator while it is already running now throws a fatal error. * Trying to use yield in finally while the generator is being force-closed (by GC) throws a fatal error. * Rewinding after the first yield now throws an Exception
* Disallow serialization and unserializationNikita Popov2012-08-201-0/+46
|
* Throw error also for return occuring before yieldNikita Popov2012-07-222-1/+14
| | | | | | | Previously only an error was thrown when return occured after yield. Also returns before the first yield would fail for by-ref generators. Now the error message is handled in pass_two, so all returns are checked.
* Remove asterix modifier (*) for generatorsNikita Popov2012-07-206-17/+6
| | | | | | | | | | | | | | | | Generators are now automatically detected by the presence of a `yield` expression in their body. This removes the ZEND_SUSPEND_AND_RETURN_GENERATOR opcode. Instead additional checks for ZEND_ACC_GENERATOR are added to the fcall_common helper and zend_call_function. This also adds a new function zend_generator_create_zval, which handles the actual creation of the generator zval from an op array. I feel like I should deglobalize the zend_create_execute_data_from_op_array code a bit. It currently changes EG(current_execute_data) and EG(opline_ptr) which is somewhat confusing (given the name).
* Add support by yielding by-referenceNikita Popov2012-07-173-0/+49
|
* Add sceleton for yield* expressionNikita Popov2012-06-192-2/+2
| | | | This does not yet actually implement any delegation.
* Implement return for generatorsNikita Popov2012-05-261-0/+12
| | | | | | | | For generators ZEND_RETURN directly calls ZEND_VM_RETURN(), thus passing execution back to the caller (zend_generator_resume). This commit also adds a check that only return; is used in generators and not return $value;.
* Add some boilerplate code for Generator classNikita Popov2012-05-204-0/+42
The Generator class now uses a zend_generator struct, so it'll be able to store additional info. This commit also ensures that Generator cannot be directly instantiated and extended. The error tests are now in a separate folder from the (yet-to-come) functional tests.