Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit 04d9e6f

Browse files
committedApr 28, 2017
Remove limit propertis from V8\Isolate
1 parent ed72501 commit 04d9e6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+248
-1553
lines changed
 

Diff for: ‎scripts/replace_expect.php

+39-16
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,25 @@
1515
$tests_dir = realpath(__DIR__ . '/../tests');
1616

1717

18-
if ($argc == 2) {
19-
$mask = str_replace(['tests/', '.phpt', '.diff'], '', $argv[1]);
18+
$mode = 'write';
19+
20+
$args = $argv;
21+
unset($args[0]);
22+
23+
foreach ($argv as $i => $item) {
24+
if ($item == '--pretend') {
25+
$mode = 'pretend';
26+
unset($args[$i]);
27+
}
28+
}
29+
30+
if (count($args) > 1) {
31+
echo 'Invalid options', PHP_EOL;
32+
exit(1);
33+
}
34+
35+
if ($args) {
36+
$mask = str_replace(['tests/', '.phpt', '.diff'], '', array_pop($args));
2037
} else {
2138
$mask = '*';
2239
}
@@ -25,41 +42,41 @@
2542

2643
foreach ($iterator as $item) {
2744
//var_dump($item);
28-
$out_file = $iterator->key();
45+
$out_file = $iterator->key();
2946
$base_name = preg_replace('/\.out$/i', '', $iterator->key());
30-
$test_file = $base_name .'.phpt';
47+
$test_file = $base_name . '.phpt';
3148

3249
$test_content = file_get_contents($tests_dir . '/' . $test_file);
3350

3451
if (false !== ($pos = strpos($test_content, '--EXPECT--'))) {
35-
printf("--EXPECT-- [%s]".PHP_EOL, $iterator->key());
52+
printf("--EXPECT-- [%s]" . PHP_EOL, $iterator->key());
3653

3754
$test_content = substr($test_content, 0, $pos);
38-
$test_content .= '--EXPECT--'.PHP_EOL;
55+
$test_content .= '--EXPECT--' . PHP_EOL;
3956
$test_content .= file_get_contents($tests_dir . '/' . $out_file);
4057
$test_content .= PHP_EOL;
4158
file_put_contents($tests_dir . '/' . $test_file, $test_content);
4259

4360
foreach (['.diff', '.exp', '.log', '.mem', '.out', '.php', '.sh'] as $ext) {
44-
@unlink($tests_dir. '/'.$base_name . $ext);
61+
@unlink($tests_dir . '/' . $base_name . $ext);
4562
}
4663

4764
continue;
48-
//} elseif (0) {
65+
//} elseif (0) {
4966
} elseif (false !== ($pos = strpos($test_content, '--EXPECTF--'))) {
5067

51-
printf("--EXPECTF-- [%s]".PHP_EOL, $iterator->key());
68+
printf("--EXPECTF-- [%s]" . PHP_EOL, $iterator->key());
5269

5370
// get replacements
5471

55-
$tests = substr($test_content, 0, $pos);
72+
$tests = substr($test_content, 0, $pos);
5673
$result = file_get_contents($tests_dir . '/' . $out_file);
5774

5875
preg_match_all('#// EXPECTF: \-\-\-(.+)#', $tests, $expectf_search);
5976
preg_match_all('#// EXPECTF: \+\+\+(.+)#', $tests, $expectf_replace);
6077

6178
if (count($expectf_search) != count($expectf_replace)) {
62-
printf("please, edit manually [%s]: searches and replaces count doesn't match".PHP_EOL, $iterator->key());
79+
printf("please, edit manually [%s]: searches and replaces count doesn't match" . PHP_EOL, $iterator->key());
6380
continue;
6481
}
6582

@@ -68,18 +85,24 @@
6885
}
6986

7087
$test_content = $tests;
71-
$test_content .= '--EXPECTF--'.PHP_EOL;
88+
$test_content .= '--EXPECTF--' . PHP_EOL;
7289
$test_content .= $result;
7390
$test_content .= PHP_EOL;
7491

75-
file_put_contents($tests_dir . '/' . $test_file, $test_content);
92+
if ($mode == 'pretend') {
93+
echo $result, PHP_EOL;
94+
echo PHP_EOL;
7695

77-
foreach (['.diff', '.exp', '.log', '.mem', '.out', '.php', '.sh'] as $ext) {
78-
@unlink($tests_dir. '/'.$base_name . $ext);
96+
} elseif ($mode = 'write') {
97+
file_put_contents($tests_dir . '/' . $test_file, $test_content);
98+
99+
foreach (['.diff', '.exp', '.log', '.mem', '.out', '.php', '.sh'] as $ext) {
100+
@unlink($tests_dir . '/' . $base_name . $ext);
101+
}
79102
}
80103

81104
continue;
82105
}
83106

84-
printf("please, edit manually [%s]".PHP_EOL, $iterator->key());
107+
printf("please, edit manually [%s]" . PHP_EOL, $iterator->key());
85108
}

Diff for: ‎src/php_v8_exceptions.h

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ extern void php_v8_throw_try_catch_exception(php_v8_context_t *php_v8_context, v
5050
#define PHP_V8_CATCH_END() } assert(!try_catch.HasCaught());
5151

5252
#define PHP_V8_MAYBE_CATCH(php_v8_context, try_catch) \
53-
php_v8_isolate_maybe_update_limits_hit((php_v8_context)->php_v8_isolate);\
5453
php_v8_isolate_limits_maybe_stop_timer((php_v8_context)->php_v8_isolate);\
5554
if ((try_catch).HasCaught()) { \
5655
php_v8_throw_try_catch_exception((php_v8_context), &(try_catch)); \

0 commit comments

Comments
 (0)
This repository has been archived.