Revision: 11416
Author: [email protected]
Date: Mon Apr 23 06:59:43 2012
Log: Fix source property of empty RegExp objects.
[email protected]
BUG=v8:1982
TEST=test262/15.10.4.1-5
Review URL: https://chromiumcodereview.appspot.com/10134010
http://code.google.com/p/v8/source/detail?r=11416
Modified:
/branches/bleeding_edge/src/bootstrapper.cc
/branches/bleeding_edge/src/heap.h
/branches/bleeding_edge/src/regexp.js
/branches/bleeding_edge/src/runtime.cc
/branches/bleeding_edge/test/mjsunit/regress/regress-1217.js
/branches/bleeding_edge/test/mozilla/mozilla.status
/branches/bleeding_edge/test/sputnik/sputnik.status
/branches/bleeding_edge/test/test262/test262.status
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Tue Apr 17 00:16:19 2012
+++ /branches/bleeding_edge/src/bootstrapper.cc Mon Apr 23 06:59:43 2012
@@ -1011,7 +1011,7 @@
proto_map->set_prototype(global_context()->initial_object_prototype());
Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map);
proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex,
- heap->empty_string());
+ heap->query_colon_symbol());
proto->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex,
heap->false_value());
proto->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex,
=======================================
--- /branches/bleeding_edge/src/heap.h Wed Apr 18 10:49:53 2012
+++ /branches/bleeding_edge/src/heap.h Mon Apr 23 06:59:43 2012
@@ -243,7 +243,8 @@
V(compare_ic_symbol, ".compare_ic") \
V(infinity_symbol, "Infinity") \
V(minus_infinity_symbol, "-Infinity") \
- V(hidden_stack_trace_symbol, "v8::hidden_stack_trace")
+ V(hidden_stack_trace_symbol, "v8::hidden_stack_trace") \
+ V(query_colon_symbol, "(?:)")
// Forward declarations.
class GCTracer;
=======================================
--- /branches/bleeding_edge/src/regexp.js Fri Apr 13 04:03:22 2012
+++ /branches/bleeding_edge/src/regexp.js Mon Apr 23 06:59:43 2012
@@ -278,11 +278,7 @@
function RegExpToString() {
- // If this.source is an empty string, output /(?:)/.
- // http://bugzilla.mozilla.org/show_bug.cgi?id=225550
- // ecma_2/RegExp/properties-001.js.
- var src = this.source ? this.source : '(?:)';
- var result = '/' + src + '/';
+ var result = '/' + this.source + '/';
if (this.global) result += 'g';
if (this.ignoreCase) result += 'i';
if (this.multiline) result += 'm';
=======================================
--- /branches/bleeding_edge/src/runtime.cc Fri Apr 20 07:12:49 2012
+++ /branches/bleeding_edge/src/runtime.cc Mon Apr 23 06:59:43 2012
@@ -1783,6 +1783,9 @@
ASSERT(args.length() == 5);
CONVERT_ARG_CHECKED(JSRegExp, regexp, 0);
CONVERT_ARG_CHECKED(String, source, 1);
+ // If source is the empty string we set it to "(?:)" instead as
+ // suggested by ECMA-262, 5th, section 15.10.4.1.
+ if (source->length() == 0) source =
isolate->heap()->query_colon_symbol();
Object* global = args[2];
if (!global->IsTrue()) global = isolate->heap()->false_value();
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-1217.js Mon Sep 26
01:42:01 2011
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-1217.js Mon Apr 23
06:59:43 2012
@@ -30,7 +30,7 @@
var proto = RegExp.prototype;
assertEquals("[object RegExp]", Object.prototype.toString.call(proto));
-assertEquals("", proto.source);
+assertEquals("(?:)", proto.source);
assertEquals(false, proto.global);
assertEquals(false, proto.multiline);
assertEquals(false, proto.ignoreCase);
=======================================
--- /branches/bleeding_edge/test/mozilla/mozilla.status Mon Apr 16 08:54:02
2012
+++ /branches/bleeding_edge/test/mozilla/mozilla.status Mon Apr 23 06:59:43
2012
@@ -600,6 +600,12 @@
js1_2/regexp/hexadecimal: FAIL_OK
+# The source field of RegExp objects is properly escaped. We match JSC.
+ecma_2/RegExp/constructor-001: FAIL_OK
+ecma_2/RegExp/function-001: FAIL_OK
+ecma_2/RegExp/properties-001: FAIL_OK
+
+
##################### FAILING TESTS #####################
# This section is for tests that fail in V8 and pass in JSC.
=======================================
--- /branches/bleeding_edge/test/sputnik/sputnik.status Mon Apr 16 08:54:02
2012
+++ /branches/bleeding_edge/test/sputnik/sputnik.status Mon Apr 23 06:59:43
2012
@@ -124,6 +124,16 @@
S8.5_A2.2: PASS, FAIL if $system == linux, FAIL if $system == macos
S8.5_A2.1: PASS, FAIL if $system == linux, FAIL if $system == macos
+# The source field of RegExp objects is properly escaped. We match JSC.
+S15.10.4.1_A3_T1: FAIL_OK
+S15.10.4.1_A3_T2: FAIL_OK
+S15.10.4.1_A3_T3: FAIL_OK
+S15.10.4.1_A3_T4: FAIL_OK
+S15.10.4.1_A3_T5: FAIL_OK
+S15.10.4.1_A4_T2: FAIL_OK
+S15.10.4.1_A4_T3: FAIL_OK
+S15.10.4.1_A4_T5: FAIL_OK
+
##################### ES3 TESTS #########################
# These tests check for ES3 semantics, and differ from ES5.
# When we follow ES5 semantics, it's ok to fail the test.
=======================================
--- /branches/bleeding_edge/test/test262/test262.status Mon Apr 16 09:33:58
2012
+++ /branches/bleeding_edge/test/test262/test262.status Mon Apr 23 06:59:43
2012
@@ -33,9 +33,15 @@
# '__proto__' should be treated as a normal property in JSON.
S15.12.2_A1: FAIL
+# Sequencing of getter side effects on receiver and argument properties
+# is wrong. The receiver callback should be called before any arguments
+# are evaluated.
# V8 Bug: http://code.google.com/p/v8/issues/detail?id=691
11.2.3-3_3: FAIL
+# Prototypal inheritance of properties does not maintain accessibility.
+# The [[CanPut]] operation should traverse the prototype chain to
+# determine whether given property is writable or not.
# V8 Bug: http://code.google.com/p/v8/issues/detail?id=1475
8.14.4-8-b_1: FAIL
8.14.4-8-b_2: FAIL
@@ -44,9 +50,6 @@
15.2.3.6-4-415: FAIL
15.2.3.6-4-420: FAIL
-# V8 Bug: http://code.google.com/p/v8/issues/detail?id=1982
-15.10.4.1-5: FAIL
-
##################### DELIBERATE INCOMPATIBILITIES #####################
# We deliberately treat arguments to parseInt() with a leading zero as
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev