Changeset 198447 in webkit
- Timestamp:
- Mar 18, 2016, 4:14:34 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r198439 r198447 1 2016-03-18 Mark Lam <mark.lam@apple.com> 2 3 ES6 spec requires that RegExpPrototype not be a RegExp object. 4 https://bugs.webkit.org/show_bug.cgi?id=155654 5 6 Reviewed by Filip Pizlo. 7 8 Rebase all the test results. 9 10 * fast/regex/script-tests/toString.js: 11 * fast/regex/toString-expected.txt: 12 * ietestcenter/Javascript/15.10.6-expected.txt: 13 * ietestcenter/Javascript/15.10.7.1-1-expected.txt: 14 * ietestcenter/Javascript/15.10.7.2-1-expected.txt: 15 * ietestcenter/Javascript/15.10.7.3-1-expected.txt: 16 * ietestcenter/Javascript/15.10.7.4-1-expected.txt: 17 * ietestcenter/Javascript/15.10.7.5-1-expected.txt: 18 * ietestcenter/Javascript/TestCases/15.10.6.js: 19 (ES5Harness.registerTest.test): 20 * ietestcenter/Javascript/TestCases/15.10.7.1-1.js: 21 (ES5Harness.registerTest.test): 22 * ietestcenter/Javascript/TestCases/15.10.7.2-1.js: 23 (ES5Harness.registerTest.test): 24 * ietestcenter/Javascript/TestCases/15.10.7.3-1.js: 25 (ES5Harness.registerTest.test): 26 * ietestcenter/Javascript/TestCases/15.10.7.4-1.js: 27 (ES5Harness.registerTest.test): 28 * ietestcenter/Javascript/TestCases/15.10.7.5-1.js: 29 (ES5Harness.registerTest.test): 30 * js/Object-getOwnPropertyNames-expected.txt: 31 * js/kde/RegExp-expected.txt: 32 * js/kde/script-tests/RegExp.js: 33 * js/script-tests/Object-getOwnPropertyNames.js: 34 * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.6/S15.10.6_A2-expected.txt: 35 1 36 2016-03-18 Brent Fulgham <bfulgham@apple.com> 2 37 -
trunk/LayoutTests/fast/regex/script-tests/toString.js
r109275 r198447 20 20 shouldBe("RegExp('/').source", '"\\\\/"'); 21 21 shouldBe("RegExp('').source", '"(?:)"'); 22 should Be("RegExp.prototype.source", '"(?:)"');22 shouldThrow("RegExp.prototype.source", '"TypeError: Type error"'); 23 23 24 24 shouldBe("RegExp('/').toString()", '"/\\\\//"'); 25 25 shouldBe("RegExp('').toString()", '"/(?:)/"'); 26 should Be("RegExp.prototype.toString()", '"/(?:)/"');26 shouldThrow("RegExp.prototype.toString()", '"TypeError: Type error"'); 27 27 28 28 // These strings are equivalent, since the '\' is identity escaping the '/' at the string level. -
trunk/LayoutTests/fast/regex/toString-expected.txt
r109275 r198447 6 6 PASS RegExp('/').source is "\\/" 7 7 PASS RegExp('').source is "(?:)" 8 PASS RegExp.prototype.source is "(?:)"8 PASS RegExp.prototype.source threw exception TypeError: Type error. 9 9 PASS RegExp('/').toString() is "/\\//" 10 10 PASS RegExp('').toString() is "/(?:)/" 11 PASS RegExp.prototype.toString() is "/(?:)/"11 PASS RegExp.prototype.toString() threw exception TypeError: Type error. 12 12 PASS testForwardSlash("^/$", "/"); is true 13 13 PASS testForwardSlash("^/$", "/"); is true -
trunk/LayoutTests/ietestcenter/Javascript/15.10.6-expected.txt
r62864 r198447 1 15.10.6 (TestCases/chapter15/15.10/15.10.6/15.10.6.js) RegExp.prototype is itselfa RegExp1 15.10.6 (TestCases/chapter15/15.10/15.10.6/15.10.6.js) RegExp.prototype is not a RegExp 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/ietestcenter/Javascript/15.10.7.1-1-expected.txt
r62864 r198447 1 15.10.7.1-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.1/15.10.7.1-1.js) RegExp.prototype.source is of type String1 15.10.7.1-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.1/15.10.7.1-1.js) RegExp.prototype.source should throw because RegExp.prototype is not a RegExp 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/ietestcenter/Javascript/15.10.7.2-1-expected.txt
r62864 r198447 1 15.10.7.2-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.2/15.10.7.2-1.js) RegExp.prototype.global is of type Boolean1 15.10.7.2-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.2/15.10.7.2-1.js) RegExp.prototype.global should throw because RegExp.prototype is not a RegExp 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/ietestcenter/Javascript/15.10.7.3-1-expected.txt
r62864 r198447 1 15.10.7.3-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.3/15.10.7.3-1.js) RegExp.prototype.ignoreCase is of type Boolean1 15.10.7.3-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.3/15.10.7.3-1.js) RegExp.prototype.ignoreCase should throw because RegExp.prototype is not a RegExp 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/ietestcenter/Javascript/15.10.7.4-1-expected.txt
r62864 r198447 1 15.10.7.4-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.4/15.10.7.4-1.js) RegExp.prototype.multiline is of type Boolean1 15.10.7.4-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.4/15.10.7.4-1.js) RegExp.prototype.multiline should throw because RegExp.prototype is not a RegExp 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/ietestcenter/Javascript/15.10.7.5-1-expected.txt
r62864 r198447 1 15.10.7.5-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.5/15.10.7.5-1.js) RegExp.prototype.lastIndex is of type Number1 15.10.7.5-1 (TestCases/chapter15/15.10/15.10.7/15.10.7.5/15.10.7.5-1.js) RegExp.prototype.lastIndex is undefined because RegExp.prototype is not a RegExp 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/ietestcenter/Javascript/TestCases/15.10.6.js
r62810 r198447 25 25 path: "TestCases/chapter15/15.10/15.10.6/15.10.6.js", 26 26 27 description: "RegExp.prototype is itselfa RegExp",27 description: "RegExp.prototype is not a RegExp", 28 28 29 29 test: function testcase() { 30 30 var s = Object.prototype.toString.call(RegExp.prototype); 31 if (s === '[object RegExp]') {31 if (s === '[object Object]') { 32 32 return true; 33 33 } -
trunk/LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.1-1.js
r62810 r198447 25 25 path: "TestCases/chapter15/15.10/15.10.7/15.10.7.1/15.10.7.1-1.js", 26 26 27 description: "RegExp.prototype.source is of type String",27 description: "RegExp.prototype.source should throw because RegExp.prototype is not a RegExp", 28 28 29 29 test: function testcase() { 30 if((typeof(RegExp.prototype.source)) === 'string') 31 return true; 30 try { 31 RegExp.prototype.source; 32 return false; 33 } catch (e) { 34 return true; 35 } 32 36 } 33 37 }); -
trunk/LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.2-1.js
r62810 r198447 25 25 path: "TestCases/chapter15/15.10/15.10.7/15.10.7.2/15.10.7.2-1.js", 26 26 27 description: "RegExp.prototype.global is of type Boolean",27 description: "RegExp.prototype.global should throw because RegExp.prototype is not a RegExp", 28 28 29 29 test: function testcase() { 30 if((typeof(RegExp.prototype.global)) === 'boolean') 31 return true; 30 try { 31 RegExp.prototype.global; 32 return false; 33 } catch (e) { 34 return true; 35 } 32 36 } 33 37 }); -
trunk/LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.3-1.js
r62810 r198447 25 25 path: "TestCases/chapter15/15.10/15.10.7/15.10.7.3/15.10.7.3-1.js", 26 26 27 description: "RegExp.prototype.ignoreCase is of type Boolean",27 description: "RegExp.prototype.ignoreCase should throw because RegExp.prototype is not a RegExp", 28 28 29 29 test: function testcase() { 30 if((typeof(RegExp.prototype.ignoreCase)) === 'boolean') 31 return true; 30 try { 31 RegExp.prototype.ignoreCase; 32 return false; 33 } catch (e) { 34 return true; 35 } 32 36 } 33 37 }); -
trunk/LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.4-1.js
r62810 r198447 25 25 path: "TestCases/chapter15/15.10/15.10.7/15.10.7.4/15.10.7.4-1.js", 26 26 27 description: "RegExp.prototype.multiline is of type Boolean",27 description: "RegExp.prototype.multiline should throw because RegExp.prototype is not a RegExp", 28 28 29 29 test: function testcase() { 30 if((typeof(RegExp.prototype.multiline)) === 'boolean') 31 return true; 30 try { 31 RegExp.prototype.multiline; 32 return false; 33 } catch (e) { 34 return true; 35 } 32 36 } 33 37 }); -
trunk/LayoutTests/ietestcenter/Javascript/TestCases/15.10.7.5-1.js
r62810 r198447 25 25 path: "TestCases/chapter15/15.10/15.10.7/15.10.7.5/15.10.7.5-1.js", 26 26 27 description: "RegExp.prototype.lastIndex is of type Number",27 description: "RegExp.prototype.lastIndex is undefined because RegExp.prototype is not a RegExp", 28 28 29 29 test: function testcase() { 30 if((typeof(RegExp.prototype.lastIndex)) === ' number')30 if((typeof(RegExp.prototype.lastIndex)) === 'undefined') 31 31 return true; 32 32 } -
trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt
r197869 r198447 57 57 PASS getSortedOwnPropertyNames(Date.prototype) is ['constructor', 'getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds', 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'toDateString', 'toGMTString', 'toISOString', 'toJSON', 'toLocaleDateString', 'toLocaleString', 'toLocaleTimeString', 'toString', 'toTimeString', 'toUTCString', 'valueOf'] 58 58 PASS getSortedOwnPropertyNames(RegExp) is ['$&', "$'", '$*', '$+', '$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8', '$9', '$_', '$`', 'input', 'lastMatch', 'lastParen', 'leftContext', 'length', 'multiline', 'name', 'prototype', 'rightContext'] 59 PASS getSortedOwnPropertyNames(RegExp.prototype) is ['compile', 'constructor', 'exec', 'flags', 'global', 'ignoreCase', ' lastIndex', 'multiline', 'source', 'sticky', 'test', 'toString', 'unicode']59 PASS getSortedOwnPropertyNames(RegExp.prototype) is ['compile', 'constructor', 'exec', 'flags', 'global', 'ignoreCase', 'multiline', 'source', 'sticky', 'test', 'toString', 'unicode'] 60 60 PASS getSortedOwnPropertyNames(Error) is ['length', 'name', 'prototype'] 61 61 PASS getSortedOwnPropertyNames(Error.prototype) is ['constructor', 'message', 'name', 'toString'] -
trunk/LayoutTests/js/kde/RegExp-expected.txt
r109275 r198447 91 91 PASS /\u0061/.source is '\\u0061' 92 92 PASS 'abc'.match(/\u0062/).toString() is 'b' 93 PASS Object.prototype.toString.apply(RegExp.prototype) is '[object RegExp]'94 PASS typeof RegExp.prototype.toString() is 'string'93 PASS Object.prototype.toString.apply(RegExp.prototype) is '[object Object]' 94 PASS RegExp.prototype.toString() threw exception TypeError: Type error. 95 95 PASS new RegExp().toString() is '/(?:)/' 96 96 PASS (new RegExp('(?:)')).source is '(?:)' -
trunk/LayoutTests/js/kde/script-tests/RegExp.js
r109275 r198447 144 144 145 145 shouldBe("Object.prototype.toString.apply(RegExp.prototype)", 146 "'[object RegExp]'");146 "'[object Object]'"); 147 147 148 148 // not sure what this should return. most importantly 149 149 // it doesn't throw an exception 150 should Be("typeof RegExp.prototype.toString()", "'string'");150 shouldThrow("RegExp.prototype.toString()", "'TypeError: Type error'"); 151 151 152 152 // Empty regular expressions have string representation /(?:)/ -
trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
r197869 r198447 66 66 "Date.prototype": "['constructor', 'getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds', 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'toDateString', 'toGMTString', 'toISOString', 'toJSON', 'toLocaleDateString', 'toLocaleString', 'toLocaleTimeString', 'toString', 'toTimeString', 'toUTCString', 'valueOf']", 67 67 "RegExp": "['$&', \"$'\", '$*', '$+', '$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8', '$9', '$_', '$`', 'input', 'lastMatch', 'lastParen', 'leftContext', 'length', 'multiline', 'name', 'prototype', 'rightContext']", 68 "RegExp.prototype": "['compile', 'constructor', 'exec', 'flags', 'global', 'ignoreCase', ' lastIndex', 'multiline', 'source', 'sticky', 'test', 'toString', 'unicode']",68 "RegExp.prototype": "['compile', 'constructor', 'exec', 'flags', 'global', 'ignoreCase', 'multiline', 'source', 'sticky', 'test', 'toString', 'unicode']", 69 69 "Error": "['length', 'name', 'prototype']", 70 70 "Error.prototype": "['constructor', 'message', 'name', 'toString']", -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.6/S15.10.6_A2-expected.txt
r62864 r198447 1 1 S15.10.6_A2 2 2 3 FAIL SputnikError: #1: RegExp.prototype.toString = Object.prototype.toString; RegExp.prototype.toString() === "[object " + "Object" + "]". Actual: [object RegExp] 3 PASS 4 4 5 5 TEST COMPLETE -
trunk/Source/JavaScriptCore/ChangeLog
r198435 r198447 1 2016-03-18 Mark Lam <mark.lam@apple.com> 2 3 ES6 spec requires that RegExpPrototype not be a RegExp object. 4 https://bugs.webkit.org/show_bug.cgi?id=155654 5 6 Reviewed by Filip Pizlo. 7 8 The ES6 spec states that RegExp.prototype should not be an instance of RegExp: 9 https://tc39.github.io/ecma262/#sec-properties-of-the-regexp-prototype-object 10 11 "The RegExp prototype object is an ordinary object. It is not a RegExp instance 12 and does not have a [[RegExpMatcher]] internal slot or any of the other internal 13 slots of RegExp instance objects." 14 15 This patch changes RegExpPrototype to conform to the above specifications. 16 17 * runtime/JSGlobalObject.cpp: 18 (JSC::JSGlobalObject::init): 19 * runtime/RegExpConstructor.cpp: 20 (JSC::RegExpConstructor::RegExpConstructor): 21 (JSC::RegExpConstructor::finishCreation): 22 * runtime/RegExpPrototype.cpp: 23 (JSC::RegExpPrototype::RegExpPrototype): 24 (JSC::RegExpPrototype::finishCreation): 25 (JSC::RegExpPrototype::getOwnPropertySlot): 26 (JSC::RegExpPrototype::visitChildren): 27 (JSC::regExpProtoFuncTest): 28 * runtime/RegExpPrototype.h: 29 (JSC::RegExpPrototype::create): 30 (JSC::RegExpPrototype::createStructure): 31 (JSC::RegExpPrototype::emptyRegExp): 32 33 * tests/es6.yaml: 34 - This patch makes the es6/miscellaneous_built-in_prototypes_are_not_instances.js 35 test now pass. However, the kangax version of this test still fails because 36 it also checks Error objects (which will be fixed in a subsequent patch). 37 38 * tests/mozilla/ecma_2/shell.js: 39 (stringify): 40 (test): 41 (getFailedCases): 42 (err): 43 * tests/stress/static-getter-in-names.js: 44 (shouldBe): 45 1 46 2016-03-18 Keith Miller <keith_miller@apple.com> 2 47 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r198348 r198447 362 362 m_arrayStructureForIndexingShapeDuringAllocation[i] = m_originalArrayStructureForIndexingShape[i]; 363 363 364 RegExp* emptyRegex = RegExp::create(vm, "", NoFlags); 365 366 m_regExpPrototype.set(vm, this, RegExpPrototype::create(vm, this, RegExpPrototype::createStructure(vm, this, m_objectPrototype.get()), emptyRegex)); 364 m_regExpPrototype.set(vm, this, RegExpPrototype::create(vm, this, RegExpPrototype::createStructure(vm, this, m_objectPrototype.get()))); 367 365 m_regExpStructure.set(vm, this, RegExpObject::createStructure(vm, this, m_regExpPrototype.get())); 368 366 m_regExpMatchesArrayStructure.set(vm, this, createRegExpMatchesArrayStructure(vm, this)); -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r198023 r198447 87 87 RegExpConstructor::RegExpConstructor(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype) 88 88 : InternalFunction(vm, structure) 89 , m_cachedResult(vm, this, regExpPrototype-> regExp())89 , m_cachedResult(vm, this, regExpPrototype->emptyRegExp()) 90 90 , m_multiline(false) 91 91 { … … 94 94 void RegExpConstructor::finishCreation(VM& vm, RegExpPrototype* regExpPrototype, GetterSetter* speciesSymbol) 95 95 { 96 Base::finishCreation(vm, regExpPrototype->classInfo()->className);96 Base::finishCreation(vm, ASCIILiteral("RegExp")); 97 97 ASSERT(inherits(info())); 98 98 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r197999 r198447 60 60 namespace JSC { 61 61 62 const ClassInfo RegExpPrototype::s_info = { " RegExp", &RegExpObject::s_info, ®ExpPrototypeTable, CREATE_METHOD_TABLE(RegExpPrototype) };62 const ClassInfo RegExpPrototype::s_info = { "Object", &Base::s_info, ®ExpPrototypeTable, CREATE_METHOD_TABLE(RegExpPrototype) }; 63 63 64 64 /* Source for RegExpPrototype.lut.h … … 78 78 */ 79 79 80 RegExpPrototype::RegExpPrototype(VM& vm, Structure* structure , RegExp* regExp)81 : RegExpObject(vm, structure, regExp)80 RegExpPrototype::RegExpPrototype(VM& vm, Structure* structure) 81 : JSNonFinalObject(vm, structure) 82 82 { 83 83 } … … 88 88 ASSERT(inherits(info())); 89 89 JSC_NATIVE_FUNCTION(vm.propertyNames->searchSymbol, regExpProtoFuncSearch, DontEnum, 1); 90 91 m_emptyRegExp.set(vm, this, RegExp::create(vm, "", NoFlags)); 90 92 } 91 93 … … 93 95 { 94 96 return getStaticFunctionSlot<Base>(exec, regExpPrototypeTable, jsCast<RegExpPrototype*>(object), propertyName, slot); 97 } 98 99 void RegExpPrototype::visitChildren(JSCell* cell, SlotVisitor& visitor) 100 { 101 RegExpPrototype* thisObject = jsCast<RegExpPrototype*>(cell); 102 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 103 Base::visitChildren(thisObject, visitor); 104 105 visitor.append(&thisObject->m_emptyRegExp); 95 106 } 96 107 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h
r196498 r198447 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003, 2007 , 2008Apple Inc. All Rights Reserved.3 * Copyright (C) 2003, 2007-2008, 2016 Apple Inc. All Rights Reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 22 22 #define RegExpPrototype_h 23 23 24 #include "RegExpObject.h"25 24 #include "JSObject.h" 25 #include "RegExp.h" 26 26 27 27 namespace JSC { 28 28 29 class RegExpPrototype : public RegExpObject {29 class RegExpPrototype : public JSNonFinalObject { 30 30 public: 31 typedef RegExpObject Base;31 typedef JSNonFinalObject Base; 32 32 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot; 33 33 34 static RegExpPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure , RegExp* regExp)34 static RegExpPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 35 35 { 36 RegExpPrototype* prototype = new (NotNull, allocateCell<RegExpPrototype>(vm.heap)) RegExpPrototype(vm, structure , regExp);36 RegExpPrototype* prototype = new (NotNull, allocateCell<RegExpPrototype>(vm.heap)) RegExpPrototype(vm, structure); 37 37 prototype->finishCreation(vm, globalObject); 38 38 return prototype; … … 46 46 } 47 47 48 JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&); 49 50 RegExp* emptyRegExp() const { return m_emptyRegExp.get(); } 51 48 52 protected: 49 RegExpPrototype(VM&, Structure* , RegExp*);53 RegExpPrototype(VM&, Structure*); 50 54 51 55 private: 52 56 void finishCreation(VM&, JSGlobalObject*); 53 57 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 58 59 WriteBarrier<RegExp> m_emptyRegExp; 54 60 }; 55 61 -
trunk/Source/JavaScriptCore/tests/es6.yaml
r198360 r198447 868 868 cmd: runES6 :normal 869 869 - path: es6/miscellaneous_built-in_prototypes_are_not_instances.js 870 cmd: runES6 : fail870 cmd: runES6 :normal 871 871 - path: es6/miscellaneous_function_length_is_configurable.js 872 872 cmd: runES6 :normal -
trunk/Source/JavaScriptCore/tests/mozilla/ecma_2/shell.js
r53061 r198447 42 42 var PASSED = " PASSED!" 43 43 var FAILED = " FAILED! expected: "; 44 45 function stringify(x) { 46 let str; 47 try { 48 str = "" + x; 49 } catch (e) { 50 str = Object.prototype.toString.call(x); 51 } 52 return str; 53 } 44 54 45 55 function test() { … … 49 59 testcases[tc].actual, 50 60 testcases[tc].description +" = "+ 51 testcases[tc].actual);61 stringify(testcases[tc].actual)); 52 62 53 63 testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; … … 168 178 for ( var i = 0; i < testcases.length; i++ ) { 169 179 if ( ! testcases[i].passed ) { 170 print( testcases[i].description +" = " + testcases[i].actual +" expected: "+ testcases[i].expect);180 print( testcases[i].description +" = " +stringify(testcases[i].actual) +" expected: "+ stringify(testcases[i].expect)); 171 181 } 172 182 } … … 178 188 writeTestCaseResult( testcases[tc].expect, 179 189 testcases[tc].actual, 180 testcases[tc].description +" = "+ testcases[tc].actual+190 testcases[tc].description +" = "+ stringify(testcases[tc].actual) + 181 191 ": " + testcases[tc].reason ); 182 192 stopTest(); … … 195 205 for ( var i = 0; i < testcases.length; i++ ) { 196 206 if ( ! testcases[i].passed ) { 197 writeLineToLog( testcases[i].description +" = " + testcases[i].actual+198 " expected: "+ testcases[i].expect);207 writeLineToLog( testcases[i].description +" = " + stringify(testcases[i].actual) + 208 " expected: "+ stringify(testcases[i].expect)); 199 209 } 200 210 } -
trunk/Source/JavaScriptCore/tests/stress/static-getter-in-names.js
r197869 r198447 4 4 } 5 5 6 shouldBe(JSON.stringify(Object.getOwnPropertyNames(RegExp.prototype).sort()), '["compile","constructor","exec","flags","global","ignoreCase"," lastIndex","multiline","source","sticky","test","toString","unicode"]');6 shouldBe(JSON.stringify(Object.getOwnPropertyNames(RegExp.prototype).sort()), '["compile","constructor","exec","flags","global","ignoreCase","multiline","source","sticky","test","toString","unicode"]'); 7 7 shouldBe(JSON.stringify(Object.getOwnPropertyNames(/Cocoa/).sort()), '["lastIndex"]');
Note:
See TracChangeset
for help on using the changeset viewer.