Index: src/libsampler/utils.h |
diff --git a/test/mjsunit/regress/regress-crbug-580506.js b/src/libsampler/utils.h |
similarity index 34% |
copy from test/mjsunit/regress/regress-crbug-580506.js |
copy to src/libsampler/utils.h |
index fb036982cfbea449c85b31c24834d43216282a49..a0e28cefc85fadac722e71e70280f38994b38f36 100644 |
--- a/test/mjsunit/regress/regress-crbug-580506.js |
+++ b/src/libsampler/utils.h |
@@ -2,21 +2,26 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-// Flags: --allow-natives-syntax |
+#ifndef V8_LIBSAMPLER_UTILS_H_ |
+#define V8_LIBSAMPLER_UTILS_H_ |
-(function() { |
- 'use strict'; |
- class A extends Function { |
- constructor(...args) { |
- super(...args); |
- this.a = 42; |
- } |
+#include "include/v8.h" |
+ |
+namespace v8 { |
+namespace sampler { |
+ |
+class Malloced { |
+ public: |
+ static void* New(size_t size) { |
+ return malloc(size); |
} |
- var v1 = new A("'use strict';"); |
- function f(func) { |
- func.__defineSetter__('a', function() { }); |
+ |
+ static void Delete(void* p) { |
+ free(p); |
} |
- var v2 = new A(); |
- f(v2); |
- f(v1); |
-})(); |
+}; |
+ |
+} // namespace sampler |
+} // namespace v8 |
+ |
+#endif // V8_LIBSAMPLER_UTILS_H_ |